Get Angle to Tangent that Intersects Point
Posted
by
Christian Stewart
on Stack Overflow
See other posts from Stack Overflow
or by Christian Stewart
Published on 2012-10-01T21:35:03Z
Indexed on
2012/10/01
21:37 UTC
Read the original article
Hit count: 364
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
© Stack Overflow or respective owner