SHARE
TWEET

Untitled

a guest Aug 13th, 2018 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     for (int i = 0; i < poly.Length; i++)
  2.     {
  3.         Point newPoint = new Point(poly[i].X, poly[i].Y);
  4.  
  5.         if (newPoint.X > oldPoint.X)
  6.         {
  7.             p1 = oldPoint;
  8.             p2 = newPoint;
  9.         }
  10.         else
  11.         {
  12.             p1 = newPoint;
  13.             p2 = oldPoint;
  14.         }
  15.  
  16.         if ((newPoint.X < p.X) == (p.X <= oldPoint.X)
  17.             && ((long)p.Y - (long)p1.Y) * (long)(p2.X - p1.X) < ((long)p2.Y - (long)p1.Y) * (long)(p.X - p1.X))
  18.         {
  19.             inside = !inside;
  20.         }
  21.  
  22.         oldPoint = newPoint;
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top