Find a tangent point on circle?

后端 未结 9 734
别跟我提以往
别跟我提以往 2020-12-09 04:33

Given a line with first end point P(x1,y1) another end point is unknown, intersect with a circle that located at origin with radius R at only one point(tangent) T(x2,y2). An

9条回答
  •  离开以前
    2020-12-09 05:29

    Given a line with first end point P(x1,y1) another end point is unknown, intersect with a circle that located at origin with radius R at only one point(tangent) T(x2,y2). Anyone know how to get the point T?

    Some of the other solutions seem a little like overkill. I think the simplest way is just to notice that this is a right triangle, with vertices P, T, and O (the origin). The angle PTO is the right angle, because a tangent line is always at a right angle to a radius.

    You know the length of TO because it's of length r and has a vertex at the origin; you know OP because you know where O and P is. Given two sides of a right triangle, it's easy to find the length and direction of the third side. This is homework, so I'll leave the rest as an exercise to the reader.

                        __...------__    T(x2, y2)                      
                   _.-''             -(+)
                ,-'                   |----             
              ,'                     |     ----
            ,'                      |       '  ----
           /                       |         `     ----       
          /                       |           `.       ----   
         /                       |             \           ----
        |                       |               |              ----
        |                      |                 |                  ----
        |                     |                  |                      ----
        |                   (+)---------------------------------------------(+) P (x1,y1)
        |                                        .'        
        |                    O                   |         
         |                                      .'         
          \                                     /          
           \                                  ,'           
            `                                /             
             '.                            ,'              
               '-.                      _,'             
                  '-._              _,(+)  T'(x3, y3)                   
                      '`--......---'                       
    

    There are two possible directions for TO, since the point T' is also a valid tangent point, so you will have two congruent triangles.

提交回复
热议问题