The equation of a tangent line to a circle ( center at $(x_m, y_m)$ and radius $r$) at the point $(x_0,y_0)$ is given by:
\begin{align} (x-x_m)(x_0-x_m)+(y-y_m)(y_0-y_m)=r^2. \end{align}
How to derive this expression?
The equation of a tangent line to a circle ( center at $(x_m, y_m)$ and radius $r$) at the point $(x_0,y_0)$ is given by:
\begin{align} (x-x_m)(x_0-x_m)+(y-y_m)(y_0-y_m)=r^2. \end{align}
How to derive this expression?
The equation of a circle with center $(x_m,y_m)$ and radius $r$ is given by $$ (x-x_m)^2+(y-y_m)^2=r^2\tag{1} $$ The derivative of $(1)$ with respect to $x$ is $$ \frac{\mathrm{d}y}{\mathrm{d}x}=-\frac{x-x_m}{y-y_m}\tag{2} $$ where $(2)$ is derived by implicit differentiation of $(1)$ with respect to $x$. Hence, the gradient of the tangent line at $(x_0,y_0)$ is $$ m=-\frac{x_0-x_m}{y_0-y_m} $$ The equation of the tangent line at $(x_0,y_0)$ is then $$ y-y_0=-\frac{x_0-x_m}{y_0-y_m}(x-x_0)\Longleftrightarrow (x_0-x_m)(x-x_0)+(y_0-y_m)(y-y_0)=0\tag{3} $$ The point $(x_0,y_0)$ lies on the circle so it should satisfy $(1)$. $$ (x_0-x_m)^2+(y_0-y_m)^2=r^2\tag{4} $$ Add $r^2$ to both sides of $(3)$ to get $$ (x_0-x_m)(x-x_0)+(y_0-y_m)(y-y_0)+r^2=r^2\tag{5} $$ Using $(4)$, we can rewrite $(5)$ as $$ \begin{align} & \left((x_0-x_m)(x-x_0)+(x_0-x_m)^2\right)+\left( (y_0-y_m)(y-y_0)+(y_0-y_m)^2\right)=r^2\\ \Longleftrightarrow& (x_0-x_m)(x-x_0+x_0-x_m)+(y_0-y_m)(y-y_0+y_0-y_m)=r^2\\ \Longleftrightarrow& (x_0-x_m)(x-x_m)+(y_0-y_m)(y-y_m)=r^2 \end{align} $$ as required.