A line going through a point, how to find it's touching point with a circle.

672 Views Asked by At

I have a circle and a point outside of it. I need to find a line passing through this point and only touching the perimeter of the circle (my intuition tells me that there are always two lines like this, is this correct?)

After finding this line (that can be represented as a vector), I need to find the touching point of the line and the circle.

I actually think I figured out the solution, but I'd like to hear if it's wrong.

enter image description here

p  = the point outside of the circle
pc = a vector from the point to the center of the circle.
u  = a normal of pc, normalized and multiplied by the radius of the circle.
v  = pc + u
d  = the touching point of the line and the circle = p + v

Is this correct?

1

There are 1 best solutions below

1
On BEST ANSWER

The following is the standard procedure of drawing a tangent from an external point P to a given circle with center C.

(1) Locate the midpoint Q of PC.

(2) Draw another circle using Q as center, QP as radius.

(3) Let the new circle cuts the old circle at R.

(4) PR is the required tangent.

enter image description here

PS. Your intuition is correct. There are two such lines (symmetrically located about PC).