0

Lets say I have the locations (Lat/Lng) A,B and C. Locations A and B are the end points of a line. C is the center of the circle with Radius R. How can I know if Line A-B intersects with the circle (regardless of the number of points or intersections)? I just need to know if there is intersection or not

Thank you

enter image description here

Snake
  • 14,228
  • 27
  • 117
  • 250
  • 1
    basic geometry: http://mathworld.wolfram.com/Circle-LineIntersection.html – runDOSrun Feb 21 '15 at 20:05
  • 1
    maybe this http://stackoverflow.com/questions/1073336/circle-line-segment-collision-detection-algorithm – Šime Tokić Feb 21 '15 at 20:06
  • I checked that before but the problem that they are x,y cooordinates. This is Lat/long. The difference is that the distance between them (by doing the d2 = y2 + x2 will return it in terms of location units. While the R distance (circle) is in terms of the meters. – Snake Feb 21 '15 at 20:37
  • Maybe you can transform the coordinates to x/y: https://stackoverflow.com/questions/5983099/converting-longitude-latitude-to-x-y-coordinate – nasch Feb 21 '15 at 20:46
  • I wish there would be an answer for the problem as opposed to comment – Snake Feb 22 '15 at 03:19

0 Answers0