Finding the a circle's tangent line which intersects a given point

AI Thread Summary
A tangent line to a circle can be found that intersects a given point in 2D space by using geometric and algebraic methods. The process involves drawing a line from the intersection point to the circle's center, bisecting that line, and constructing a new circle at the midpoint with a radius equal to half the distance between the center and the given point. The intersection points of this new circle with the original circle provide the points where the tangent line touches the circle. The discussion also clarifies a typo in the equations and provides a programmatic solution for calculating the tangent points. Understanding these methods allows for effective determination of tangent lines to circles in various scenarios.
jla2125
Messages
16
Reaction score
0

Homework Statement


So, it's my understanding that there must exist a line which is tangent to a given circle and intersects a given point in 2D space. I'm trying to find that line. Any form will do, but I'm currently aiming for the coordinates of the two points: the intersection point, and the point that lies on the given circle. I already have the intersection point, and the circle's location, and the circle's radius.


Homework Equations


None that work...


The Attempt at a Solution


After several hours of fiddling, this is what's given me the best approximation so far. However, it doesn't work for all positions of the circle.

tangentx = circlex - r;
tangenty = -r * sin(\theta) + circley;

I've gone through several iterations of things like this, and I have a sort of visualization I whipped up in Flash, as that's where this whole thing will eventually end up. Give it a go http://jeremyabel.com/secret/rubber_band.html" Grab the red line, and you'll see the blue circle, along with the yellow line, which is being drawn according to the equation above. In the case above, theta = the angle of the green center line. As you can see, it works good enough for my purposes when you're below the line and even above it, but once you go to the upper right, it all goes down hill from there...

Any help would be appreciated!
 
Last edited by a moderator:
Physics news on Phys.org
Geometrically, you can do this: Draw the line connecting the point to the center of the circle. Bisect that line segment. Using that point as center and the distance from that point to the center of the circle (half the distance from the center of the circle to the given point, as radius strike a new circle. The two points at which the circles cross will be points where the line from the given point will be tangent to the given circle.

That is true because any point on a circle makes a right angle between the lines from the ends of any diameter to that point.

Algebraically, you can do this:

Suppose the given point is (x_0, y_0) and the circle has center at (x_1, y_1) and radius r. The midpoint between the center of the circle and the given point is ((x_1+ x_0)/2, (y_1+ y_0)/2) and half the distance is

\sqrt{(x_1- x_0)^2+ (y_1- y_0)^2}/2.

The given circle has equation
(x- x_1)^2+ (y- y_1)^2= r^2
and the circle with center at the midpoint, radius equal to half the distance between the given point and center of the circle has equation

(x- (x_0+ x_1)/2)^2+ (y- (y_0+ y_2)/2)^2= \frac{(x_1- x_0)^2+ (y_1-y_0)^2}{4}.

Solve those two equations for the points at which the line from the given point is tangent to the circle. You can then use the "two-point" formula to find the equation of the circle.
 
Last edited by a moderator:
No freakin' way! I can't believe I didn't see that before! That circle trick's pretty neat.

Now, about that algebra: which two equations do I need to solve to get the points? are you referring to the last two? Also, the last equation has a variable I haven't seen elsewhere: (y_2). What is that referring to? I take it that if I solve that last equation for x and y I'll get the coordinates of the tangent point? Sorry I'm not up on all this, I haven't done this stuff since high school...
 
There were only two equations in my post!

They were
(x- x_1)^2+ (y- y_1)^2= r^2
and
(x- (x_0+ x_1)/2)^2+ (y- (y_0+ y_1)/2)^2= \frac{(x_1- x_0)^2+ (y_1-y_0)^2}{4}

The "y_2" was a typo. Thanks for pointing it out.
 
Thanks for the help! I got it all figured out pretty quickly after that. If anyone's interested, here's how I did it programmatically:

given circle's center points c1 and c2, and circle's radii r1 and r2:

d_x = c_2_x - c_1_x
d_y = c_2_y - c_1_y
d_a = d_x^{2} * d_y^{2}

a = ({r_1{}}^{2} - {r_2{}}^{2} + d_a) / 2d
h = \sqrt{{r_1{}}^{2} - a^{2}}

x_2 = \frac{c_1_x + a(c_2_x - c_1_x)}{d}
y_2 = \frac{c_1_y + a(c_2_y - c_1_y)}{d}

p_1 = (x_2 + h(c_2_y - c_1_y) / d, y_2 - h(c_2_x - c_1_x) / d))
p_2 = (x_2 - h(c_2_y - c_1_y) / d, y_2 + h(c_2_x - c_1_x) / d))

p_1 and p_2 are the two intersection points.
 
I picked up this problem from the Schaum's series book titled "College Mathematics" by Ayres/Schmidt. It is a solved problem in the book. But what surprised me was that the solution to this problem was given in one line without any explanation. I could, therefore, not understand how the given one-line solution was reached. The one-line solution in the book says: The equation is ##x \cos{\omega} +y \sin{\omega} - 5 = 0##, ##\omega## being the parameter. From my side, the only thing I could...
Back
Top