Results 1 to 7 of 7
Like Tree1Thanks
  • 1 Post By Wilmer

Math Help - Regarding a Line Tangent to a Circle

  1. #1
    Newbie
    Joined
    Jul 2012
    From
    Costa Rica
    Posts
    3

    Regarding a Line Tangent to a Circle

    Hello Math Help Forum, I'm new here, and would first of all like to say hi

    I am currently working on a 2D Lighting Engine software, and need to be able to determine a certain point (or at least the equation of the line passing through it). Here's an illustration:

    Regarding a Line Tangent to a Circle-shadow-fin.png

    What I would like to do is, knowing the values of r, x, y, x1, and y1, to find the values of x2 and y2 in terms of these variables (note that (x2, y2) is the tangent point of the line passing through the circle, (x, y) is the center of the circle, though not necessarily (0, 0), (x1, y1) is just a random point outside of the circle, and 'r' is the radius of the circle).

    I had thought of using the right triangle to find the measurement of the upper side and equate that to the distance between (x1, y1) and (x2, y2), but ended up with a very complex equation that I probably wasn't able to simplify because of lack of further knowledge.

    Hope I made myself clear, thank you!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,605
    Thanks
    1574
    Awards
    1

    Re: Regarding a Line Tangent to a Circle

    Quote Originally Posted by Patio111 View Post
    Click image for larger version. 

Name:	Shadow Fin.png 
Views:	8 
Size:	21.9 KB 
ID:	24281
    What I would like to do is, knowing the values of r, x, y, x1, and y1, to find the values of x2 and y2 in terms of these variables (note that (x2, y2) is the tangent point of the line passing through the circle, (x, y) is the center of the circle, though not necessarily (0, 0), (x1, y1) is just a random point outside of the circle, and 'r' is the radius of the circle).
    There is a messy but easy solution. I will change notation to a more standard form.
    Let (a,b) be the external point. (you called this (x_1,y_1)).
    Let (h,k) be the center of the circle. (you called this (x,y)).
    Let (x,y) be the point of tangentany . (you called this (x_2,y_2)).

    (a-h)^2+(b-k)^2=(x-a)^2+(y-b)^2+(x-h)^2+(y-k)^2 AND

    \frac{y-k}{x-h}=-\frac{h-a}{k-b}.

    Solve for (x,y)

    BTW: r^2=(x-h)^2+(y-k)^2
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jul 2012
    From
    Costa Rica
    Posts
    3

    Re: Regarding a Line Tangent to a Circle

    Thanks for responding.

    The problem is that I don't know how to solve for (x, y) once I get to

    (a - h)2 + (b - k)2 = (x - a)2 + (y - b)2 + r2

    By the way, shouldn't it be (y - k) / (x - h) = - (y - b) / (x - a) ?

    EDIT: Actually, I think it should be (y - k) / (x - h) = - (x - a) / (y - b) because the slope or perpendicular lines has a relation of m_1 = 1 / m_2.
    Last edited by Patio111; July 13th 2012 at 09:02 PM.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Dec 2007
    From
    Ottawa, Canada
    Posts
    3,080
    Thanks
    66

    Re: Regarding a Line Tangent to a Circle

    Thanks from Patio111
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Jul 2012
    From
    Costa Rica
    Posts
    3

    Re: Regarding a Line Tangent to a Circle

    Thanks! I had searched in Google already, but only found cases where the center of the circle was assumed to be the origin.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Joined
    Dec 2007
    From
    Ottawa, Canada
    Posts
    3,080
    Thanks
    66

    Re: Regarding a Line Tangent to a Circle

    Well, regardless, your problem really simplifies to:
    Code:
    B(x1,y1)
    
    a            c
    
    C            b             A(x2,y2)
    Given the coordinates of A and B and the length (radius) of shorter leg BC,
    calculate the coordinates of C; enough info is given to calculate b and c.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    Joined
    Dec 2007
    From
    Ottawa, Canada
    Posts
    3,080
    Thanks
    66

    Re: Regarding a Line Tangent to a Circle

    Code:
    B(f,g)
    
    a            c
    
    C(x,y)       b             A(d,e)
    That's right triangle ABC; givens are sides a,b,c and coordinates d,e,f,g.
    (b and c are easily calculated; so I'm using them as givens)
    c = SQRT[(e-g)^2 + (f-d)^2]
    b = SQRT(c^2 - a^2)

    U = 180 - ASIN(b/c) - ASIN[(e-g)/c]

    x = a * SIN(90-U) + f

    y = a * SIN(U) + g

    Try it with this "all integers" example:
    a = 70 (that's the radius), d = 40, e = 250, f = 190, g = 50;
    so b = 240 and c = 250.

    That'll result in x = 232 and y = 106.
    Last edited by Wilmer; July 15th 2012 at 05:24 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Circle, tangent line, and a point not on the circle
    Posted in the Pre-Calculus Forum
    Replies: 5
    Last Post: March 31st 2011, 01:40 PM
  2. Replies: 1
    Last Post: June 8th 2010, 04:44 PM
  3. finding the equation of the tangent line to a circle
    Posted in the Pre-Calculus Forum
    Replies: 5
    Last Post: April 13th 2010, 10:20 AM
  4. Circle tangent to the line.
    Posted in the Geometry Forum
    Replies: 11
    Last Post: January 15th 2010, 09:09 AM
  5. Tangent Line of a Circle
    Posted in the Pre-Calculus Forum
    Replies: 7
    Last Post: October 8th 2009, 11:14 AM

Search Tags


/mathhelpforum @mathhelpforum