Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < poly.Length; i++)
- {
- Point newPoint = new Point(poly[i].X, poly[i].Y);
- if (newPoint.X > oldPoint.X)
- {
- p1 = oldPoint;
- p2 = newPoint;
- }
- else
- {
- p1 = newPoint;
- p2 = oldPoint;
- }
- if ((newPoint.X < p.X) == (p.X <= oldPoint.X)
- && ((long)p.Y - (long)p1.Y) * (long)(p2.X - p1.X) < ((long)p2.Y - (long)p1.Y) * (long)(p.X - p1.X))
- {
- inside = !inside;
- }
- oldPoint = newPoint;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement