• Advertisement
Sign in to follow this  

Is there a better way to do this?

This topic is 2197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[font="Calibri"][size="3"][color="#000000"]I have been working on trying to get an implementation of reciprocal obstacle avoidance working.[/color][/size][/font]

[size="3"][color="#000000"][font="Calibri"]I need to find the point tangent to a circle from the origin (0,0). I know how to do this using two circles kind of like the diagram below. I was planning to us the quadratic equation to find the two tangents[/font] [font="Calibri"]points.[/font][/color][/size]
[font="Calibri"][size="3"][color="#000000"][url="http://www.nvcc.edu/home/tstreilein/constructions/Circle/circle5.htm"]http://www.nvcc.edu/home/tstreilein/constructions/Circle/circle5.htm[/url][/color][/size][/font]
[font="Calibri"][size="3"][color="#000000"]I need both tangent points[/color][/size][/font]
[font="Calibri"][size="3"][color="#000000"]I know[/color][/size][/font]
[font="Calibri"][size="3"][color="#000000"]1: circle center [/color][/size][/font]
[font="Calibri"][size="3"][color="#000000"]2: radius [/color][/size][/font]
[font="Calibri"][size="3"][color="#000000"]3: And that the tangent points must pass through the origin (0,0).[/color][/size][/font]
[font="Calibri"][color="#000000"][size="3"]I have not used much trig in many years. I[/size][size="3"][font="Times New Roman"]s there [/font]a better trigonometry based way? I know how to find the lengths of all sides and the interior angles. But not how to find the tangent points. [/size][/color][/font]

Share this post


Link to post
Share on other sites
Advertisement
Hi Normalized,

Since the tangent is always perpendicular to the line through the center of the circle and the point where the tangent touches the circle, you're dealing with a right angled triangle where you know the hypotenuse (distance from the origin to the center of the circle) and one of the sides (the radius of the circle). So the line segment from the origin to the tangent point on the circle has a length of

L = sqrt(H^2 - R^2)

where H is the length of the line from the origin to the center of the circle and R is the radius of the circle. The angle between the tangent and the line from the origin to the center of the circle is

theta = asin(R/H)

So you can create a vector of length L that is parallel to line from the origin to the center of the circle, and rotate it by +/- theta to get the tangent points.

-Josh

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement