# Equation of Straight Line Tangent to Circle

## Theorem

Let $\tuple {a, b}$ be the center of a circle $\CC$ whose radius is $r$.

Let $P_n = \tuple {x_n, y_n}$ be any point on $\CC$.

The equation of a non-vertical tangent line $\TT$ to $\CC$ is given by:

$y - y_n = \dfrac {a - x_n} {y_n - b} \paren {x - x_n}$

The equations of the vertical tangent lines to $\CC$ are:

$x = r - a$ for $P = \tuple {r - a, b}$
$x = a - r$ for $P = \tuple {a - r, b}$

## Proof

### Non-Vertical Tangent Lines

From Equation of Circle, $\CC$ can be described on the $x y$-plane in the form:

$\paren {x - a}^2 + \paren {y - b}^2 = r^2$

where $P = \tuple {a, b}$ is the center of the circle and $r$ is the radius.

We use the definition of the derivative as the gradient of the tangent line $\TT$.

Taking the derivative with respect to $x$ of both sides of the equation we get:

 $\ds 2 \paren {x - a} + 2 \paren {y - b} \frac {\d y} {\d x}$ $=$ $\ds 0$ Derivative of Constant, Chain Rule for Derivatives, Power Rule for Derivatives $\ds \leadsto \ \$ $\ds \frac {\d y} {\d x}$ $=$ $\ds \frac {a - x} {y - b}$

This is the slope at any point on $\CC$.

From the slope-intercept form of a line, the equation of such a line is:

$y - y_n = m \paren {x - x_n}$

given any point $\paren {x_n, y_n}$ and the gradient $m$.

For $\TT$:

$m = \valueat {\dfrac {\d y} {\d x} } {x \mathop = x_n, y \mathop = y_n}$

Thus the equation of $\TT$ is:

$y - y_n = \dfrac {a - x_n} {y_n - b} \paren {x - x_n}$

$\Box$