Results 1 to 9 of 9

Math Help - tangent angle

  1. #1
    Junior Member
    Joined
    May 2007
    Posts
    42

    tangent angle

    Hi

    What is the formula for finding the angle of the tangent line. ie. I need angle of the line "ab"

    Thanks in advance.
    Attached Thumbnails Attached Thumbnails tangent angle-tangent.png  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,962
    Thanks
    1784
    Awards
    1
    Quote Originally Posted by kumar View Post
    What is the formula for finding the angle of the tangent line. ie. I need angle of the line "ab"
    What angle?
    You need to supply more information and/or directions.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    May 2007
    Posts
    42
    I want to find the slope of the line "ab". I know the circle radius, the point(x and y) where the line is touching the circle and also I know the line width. The line can touch any point on the circle and it can be in any direction see the picture.

    Thanks.
    Attached Thumbnails Attached Thumbnails tangent angle-tangent.png  
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Aug 2009
    Posts
    14
    Quote Originally Posted by kumar View Post
    I want to find the slope of the line "ab". I know the circle radius, the point(x and y) where the line is touching the circle and also I know the line width. The line can touch any point on the circle and it can be in any direction see the picture.

    Thanks.

    Assuming the centre of your circle is at the origin (0,0),
    then the slope of the radius m_r at point (x,y) is :-

    m_r = y/x

    The tangent is at right angles to the radius.
    For lines at right angles, the product of the slopes is equal to 1.
    So the slope of the tangent m_t at point (x,y) times m_r is equal to 1 :-

    m_r * m_t = 1
    then
    m_t = 1/m_r
    and
    m_t = x/y

    If you want the angle A of the tangent, just find the inverse tan of the slope :-

    A = arctan(m_t)
    or
    A = arctan(x/y)
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    May 2007
    Posts
    42
    Thanks for your reply. Actually I want to calculate the tangent line starting point(x2,y2) and ending point(x3,y3). I Know the circle radius(r), tangent line width, in the circle where the tangent line intersecting(x1,y1) ,center point of the circle (c) and radius angle. For different radius angle I want to calculate tangent line start and end points. The tangent line center point always touches the circle.
    Attached Thumbnails Attached Thumbnails tangent angle-tangent1.png  
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Aug 2009
    Posts
    14
    Quote Originally Posted by kumar View Post
    Thanks for your reply. Actually I want to calculate the tangent line starting point(x2,y2) and ending point(x3,y3). I Know the circle radius(r), tangent line width, in the circle where the tangent line intersecting(x1,y1) ,center point of the circle (c) and radius angle. For different radius angle I want to calculate tangent line start and end points. The tangent line center point always touches the circle.

    OK Ill have a go

    Let your circle center be at (xc,yc)
    Radius angle = Ar
    Tangent angle = At

    then x1 = xc + (r * cos(Ar))
    and y1 = yc + (r * sin(Ar))

    From these and my post above

    At = arctan(x1/y1)

    [note - if you are doing this on a computer then use arctan2()
    You may also be able to find the angle if you just add 90 deg or pi/2 rad to the radius angle ie
    At = Ar + 90
    or
    At = Ar + (pi/2) ]

    Let delta_x = difference in x values between points 1 & 2, and between points 3 & 1
    delta_y = difference in y values
    and L = tangent line length
    then...

    delta_x = cos(At) * L / 2
    and
    delta_y = sin(At) * L / 2

    Now you can find the start and end points...

    x2 = x1 - delta_x
    y2 = y1 - delta_y
    and
    x3 = x1 + delta_x
    y3 = y1 + delta_y

    I haven't tested this, so you will have to check it to make sure it works.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Junior Member
    Joined
    May 2007
    Posts
    42
    Hi
    Thanks for your reply. But this formula is giving correct result only for the radius angles 0 , 90, 180, 270 and 360 for other angles is not giving correct results. for some angles the points(x2,y2 andx3,y3) are going inside of the circle But the points should be always outside of the circle for all radius angles(see diagram).

    I am using the belew code

    cicle center point - 200, 200
    radius - 150
    line length = 200

    double x = (200+ (150*Math.cos(90*(Math.PI/180))));
    double y = (200+(150*Math.sin(90*(Math.PI/180))));
    long tangentAngle = Math.round(Math.atan( (200-x) / (200-y )) * (180 / Math.PI));
    double deltaX = Math.cos(tangentAngle * Math.PI / 180) * 200/2;
    double deltaY = Math.sin(tangentAngle * Math.PI / 180) * 200/2;
    double x2 = x - deltaX;
    double y2 = y - deltaY;
    double x3 = x + deltaX;
    double y3 = y + deltaY;
    Attached Thumbnails Attached Thumbnails tangent angle-points.png  
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Aug 2009
    Posts
    14
    Quote Originally Posted by kumar View Post
    Hi
    Thanks for your reply. But this formula is giving correct result only for the radius angles 0 , 90, 180, 270 and 360 for other angles is not giving correct results. for some angles the points(x2,y2 andx3,y3) are going inside of the circle But the points should be always outside of the circle for all radius angles(see diagram).

    I am using the belew code

    cicle center point - 200, 200
    radius - 150
    line length = 200

    double x = (200+ (150*Math.cos(90*(Math.PI/180))));
    double y = (200+(150*Math.sin(90*(Math.PI/180))));
    long tangentAngle = Math.round(Math.atan( (200-x) / (200-y )) * (180 / Math.PI));
    double deltaX = Math.cos(tangentAngle * Math.PI / 180) * 200/2;
    double deltaY = Math.sin(tangentAngle * Math.PI / 180) * 200/2;
    double x2 = x - deltaX;
    double y2 = y - deltaY;
    double x3 = x + deltaX;
    double y3 = y + deltaY;

    Hi kumar,

    I can see two potential problems here...

    1) Using atan(x/y) to find the Tangent Angle will give odd results as it cant check which quadrant it is operating in in order to give the correct output. This is why I suggested using atan2, which can give correct output over the full 360 deg range, but not all software/calculators support it. Its easier in this case to just add 90 deg or pi/2 rad to the Radius Angle to find the Tangent Angle...

    long tangentAngle = RadiusAngle + 90;

    2) Its not clear how you are inputting the Radius Angle into your code but you could be having a problem with the fact you are measuring the angle counter-clockwise while you software is expecting it to be clockwise. If so then just subtract the Radius Angle from 360 to obtain the correct Radius Angle...

    Radius Angle = 360 - Radius Angle

    I was able to get it to work on my system with both these fixes enabled,
    hope this helps.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Junior Member
    Joined
    May 2007
    Posts
    42
    Hi bowline,

    Thanks for your reply. I did the change first one(adding 90 degree to radius angle), It is working fine.

    Thanks
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Angle between circle and tangent
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: July 11th 2011, 05:12 AM
  2. Replies: 1
    Last Post: May 13th 2011, 08:44 AM
  3. Angle between radius vector and tangent line
    Posted in the Geometry Forum
    Replies: 1
    Last Post: March 16th 2010, 01:04 PM
  4. Tangent of Acute Angle
    Posted in the Calculus Forum
    Replies: 1
    Last Post: August 26th 2009, 04:41 AM
  5. Tangent between two circle changing with angle
    Posted in the Trigonometry Forum
    Replies: 0
    Last Post: July 9th 2009, 03:24 PM

Search Tags


/mathhelpforum @mathhelpforum