Message 1 of 11
polylines- ??? Urgent

Not applicable
10-31-2003
12:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have to check if a point lies inside a closed polyline.
The suggested soln was ,
Consider a polygon made up of N vertices (xi,yi) where i ranges from 0 to
N-1. The last vertex (xN,yN) is assumed to be the same as the first vertex
(x0,y0), that is, the polygon is closed. To determine the status of a point
(xp,yp) consider a horizontal ray emanating from (xp,yp) and to the right.
If the number of times this ray intersects the line segments making up the
polygon is even then the point is outside the polygon. Whereas if the number
of intersections is odd then the point (xp,yp) lies inside the polygon. good
luck
This is fine. but when i use AddRay to create a ray, i dont understand how
to specify the second point and how to specify the direction (right
direction) ?
Any help is appreciated.
Thanks,
TI
I have to check if a point lies inside a closed polyline.
The suggested soln was ,
Consider a polygon made up of N vertices (xi,yi) where i ranges from 0 to
N-1. The last vertex (xN,yN) is assumed to be the same as the first vertex
(x0,y0), that is, the polygon is closed. To determine the status of a point
(xp,yp) consider a horizontal ray emanating from (xp,yp) and to the right.
If the number of times this ray intersects the line segments making up the
polygon is even then the point is outside the polygon. Whereas if the number
of intersections is odd then the point (xp,yp) lies inside the polygon. good
luck
This is fine. but when i use AddRay to create a ray, i dont understand how
to specify the second point and how to specify the direction (right
direction) ?
Any help is appreciated.
Thanks,
TI