The aim of this post is to calculate the coordinates of touching points of a tangent on a circle. As illustrated on the figure bellow, four configurations may exist in the general case.
- and are respectively the radius and center of the first circle.
- and are respectively the radius and center of the second circle.
- is the touching point of the tangent and the first circle.
- is the touching point of the tangent and the second circle.
We first consider the fact that each point lies on a circle :
We now consider the fact that each Tangent is perpendicular to the radius :
It become possible to solve this four equations and thus to find the four unknow. Unfortunatly, it is not linear and solving such system is complex.
Fortunatly, Thales configurations make it simpler and alows us to easily calculate .
In this configuration, the point is added on the radius of in such a way that
The triangle is rectangle and . Based on this triangle, we can deduce that :
From the previous equation, we can deduce that the first configuration tangent may exist only if ie. none of the circle is fully included in the other.
In this new configuration, points and are added in such a way that and . Note that according to Thales :
As previously, the triangle is rectangle.
It becomes thus easy to deduce that :
From the previous equation, we can deduce that the second configuration tangent may exist only if ie. none of the circle is fully included in the other.
Simplifying the equations
Once is known, equations can be reformulated. Let be equal to , equations can be rewriten :
We now have two independant non-linear systems to solve. Futhermore, due to the symetry, solving one will solve the whole problem.
Solving the equations
As the systems are equivalent, we will focus on solving the first one :
It is clear that the geometrical solution is the intersection of two circles of centers and with respective radius of and .
The coordinates of are given by :
In the same way, it is possible to deduce the coordinates of :
A quick matlab test :