Android app on Google Play

Circle

Drawing of a circle with a tangent
A tangent is a line touching the circle’s periphery only in one point, the intersection point.

The tangent is always perpendicular to the radius; hence the distance between the center point and the intersection point is the radius r.

It is possible to determine the function for the tangent as long as the circle’s equation and the coordinates for the intersection point are given.


Example:
A circle’s equation is:

(x-1)^2+(y-2)^2=4

The intersection between the circle and the tangent is in the point (2,3).

First we need to determine the gradient of the line from the center point to the intersection point (the radius). By looking at the circle’s equation we can determine the coordinates for the center point, which are (1,2).

The gradient of the radius is:

a_{radius}=frac{y_2-y_1}{x_2-x_1}=frac{2-1}{3-2}=frac{1}{1}=1

Because we know that the radius and the tangent are perpendicular to each other, and because the product of the gradients of two perpendicular lines always is -1, it's possible to determine the tangent’s gradient.

a_{radius}*a_{tangent}=-1\Leftrightarrow
1*a_{tangent}=-1\Leftrightarrow
a_{tangent}=-1

Now, we just have to substitude the coordinates of the intersection point and the tangents gradient into a straight line equation and isolate b:


y_1=a*x_1+b\Leftrightarrow
3=-1*2+b\Leftrightarrow
3=-2+b\Leftrightarrow
b=3+2\Leftrightarrow
b=5

The function of the tangent is then:

f(x)=a*x+b\Leftrightarrow
f(x)=-1*x+5\Leftrightarrow
f(x)=-x+5