polygon intersection
Hello Everyone!
Here in the near future I am going to need a function to find out where on a
polygon a ray (or line-segment) will intersect given the starting point of
the line and either the ending point or a directional vector of the same
line and the points on a polygon. I would want this function to return 0
(zero) if the line did NOT intersect the polygon and the {X,Y} coordinants
of such an intersection if it did. Here is a skeleton function for this:
function Intersect( atom x1, atom y1, atom x2, atom y2, sequence poly )
return {x,y}
end function
I need this function to be as fast as possible. I can think of a few "brute
foce" methods to accomplish this but nothing that would be efficient. As I
implied above the x2,y2 can define a directional vector or an ending point.
Just pick whichever format can be used to produce the fastest results. If
anyone can do this I would be very grateful. I don't need it right now but
might in a day or two.
thanks in advance,
Lewis Townsend
>
|
Not Categorized, Please Help
|
|