Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int PointInConvexPolygon(Point p, int n, Point v[])
- {
- int low = 0, high = n;
- do {
- int mid = (low + high)/2;
- if (TriangleIsCCW(v[0], v[mid], p))
- low = mid;
- else
- high = mid;
- }
- while (low + 1 < high);
- if (low == 0 || high == n) return 0;
- return TriangleIsCCW(v[low], v[high], p);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement