I have a circle around a given point, call this point (x1, y1). I know the radius of the circle around this point. I also have a second point (x2, y2), that is a distance away, outside the radius of the circle.
I need a algebraic way through code to calculate the heading (angle from vertical) needed to intersect the circle at 90* to the center point (I.E. get the angle of the tangent intersecting line 2) around the point (x1, y1) from the second point (x2, y2)
A bit of background: Essentially the two points are GPS coordinates on a 2D map, I need to know the target heading to intersect the circle in order to follow its path around the center point.
Thanks!
Christian
If I understand the problem right:
You need to find tangent from point to circle.
There are two equations – first is for perpendicularity of tangent and radius, and second for radius length:
When point (x2,y2) is outside the circle, then this system has two solutions for tangent point (there are two tangent lines)