[Math] How to calculate the two tangent points to a circle with radius R from two lines given by three points

analytic geometrycirclesgeometry

I need to calculate the two tangent points of a circle with the radius $r$ and two lines given by three points $Q(x_0,y_0)$, $P(x_1,y_1)$ and $R(x_2,y_2)$.

Sketch would explain the problem more. I need to find the tangent points $A(x_a,y_a)$ and $B(x_b,y_b)$. Note that the center of the circle is not given. Please help.

enter image description here

Best Answer

An identity that might prove useful in this problem is $$ \cot\left(\frac{\theta}{2}\right)=\frac{\sin(\theta)}{1-\cos(\theta)}=\frac{1+\cos(\theta)}{\sin(\theta)}\tag{1} $$ In $\mathbb{R}^3$, one usually uses the cross product to compute the sine of the angle between two vectors. However, one can use a two-dimensional analog of the cross product to do the same thing in $\mathbb{R}^2$.

$\hspace{5cm}$two-dimensional cross product

In the diagram above, $(x,y)\perp(y,-x)$ and so the $\color{#FF0000}{\text{red angle}}$ is complementary to the $\color{#00A000}{\text{green angle}}$. Thus, $$ \begin{align} \sin(\color{#FF0000}{\text{red angle}}) &=\cos(\color{#00A000}{\text{green angle}})\\[6pt] &=\frac{(u,v)\cdot(y,-x)}{|(u,v)||(y,-x)|}\\[6pt] &=\frac{uy-vx}{|(u,v)||(x,y)|}\tag{2} \end{align} $$ $uy-vx$ is the normal component of $(u,v,0)\times(x,y,0)$; thus, it is a two dimensional analog of the cross product, and we will denote it as $(u,v)\times(x,y)=uy-vx$.

Let $u_a=\frac{Q-P}{|Q-P|}$ and $u_b=\frac{R-P}{|R-P|}$, then since $$ |A-P|=|B-P|=r\cot\left(\frac{\theta}{2}\right) $$ we get $$ \begin{align} A &=P+ru_a\cot\left(\frac{\theta}{2}\right)\\ &=P+ru_a\frac{1+u_a\cdot u_b}{|u_a\times u_b|} \end{align} $$ and $$ \begin{align} B &=P+ru_b\cot\left(\frac{\theta}{2}\right)\\ &=P+ru_b\frac{1+u_a\cdot u_b}{|u_a\times u_b|} \end{align} $$ where we take the absolute value of $u_a\times u_b$ so that the circle is in the direction of $u_a$ and $u_b$.

Related Question