I have a circle which is actually a latlon position with a radius measured in meters. And I also have a road A-B defined as two lat-lon positions. How do I find whether that road cross inside the circle or not. Is it possible without projection latlon positions into xy positions? If possible please tell me how to do it. I’m actually trying to implement a snap-to-road functionality in a navigation software. So this is not a homework and straight forward usable procedure is very much appreciated as I’m very bad in maths.
Thanks.
I do not know the lat-long representation.
But – in general this question does not require a high math.
First build the equation of the Line between A to B (call the line L1).
Then find the equation of the perpendicular line to L1 that pass through the center of the circle (call it L2).
Then find the intersection of the two equations and check if the intersection point is inside the circle and if it is in [A-B].