On Sep 14, 6:22 am, KirAsh4 <kira...@gmail.com> wrote: > Anyone got a clipping algorithm to check whether a Polyline goes > through a (circle) Polygon? I don't want to reinvent the wheel if I > don't have to. > > I have all the vertexes of the Polyline defined. I have all the > points used to create the circle Polygon. Do I have to trace each > Polyline and check each individual vertex, see if it falls inside of > the circle? Seems a bit of an overhead there ...
If it really is a circle, just calculate the distance from each line segment to the center of the circle. If it is less than the radius of the circle, Bingo. http://www.softsurfer.com/Archive/algorithm_0102/algorithm_0102.htm If you check out the Douglas-Peucker point reduction algorithm, you will find the same formula used to determine pivots. http://www.softsurfer.com/Archive/algorithm_0205/algorithm_0205.htm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to google-maps-api@googlegroups.com To unsubscribe from this group, send email to google-maps-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en -~----------~----~----~----~------~----~------~--~---