Holland

Untitled

Jun 2nd, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. function IsPointInsideFourCorners(point, corner)
  2. {
  3. for(int i = 0; i<4; i++)
  4. {
  5. vector dist = corner[(i+1)%4] - corner[i]; // end - begin
  6. vector point2check = point - corner[i];
  7. if(dist.x*point2check.y-dist.y*point2check.x<0)
  8. return false;
  9. }
  10. return true;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment