I am working on a track editor and have found myself in a situation where I need to define two touching circles. Ideally I would like to know the centre point, and radius of these circles.
The information I have is a point on the circumference of each of the circles, and the tangent to the circle at that point.
On my own I have figured out that if I know the tangents at those points I know the lines on which the centre points must lie.
C1 is the centre of the first circle I am looking for
P1 is a point on the circumference of the circle at which I know the tangent
A is the normal to the tangent that I know at P1
C2 is the centre of the second circle I am looking for
P2 is a point on the circumference of the circle at which I know the tangent
B is the normal to the tangent that I know at P2
C1 = P1 - t1 * A
C2 = P2 - t2 * B
I also know that the distance between the two centres will be equal to the sum of the distance of the centres from the points on the circumference. Because I am looking for two circles that touch, but do not overlap.
|C1 - P1| + |C2 - P2| = |C1 - C2|
It seems that finding C1 and C2 is dependent on finding the scalars t1 and t2 such that the last equation is true.
Hopefully this is really simple, and I just don't know the technique to use to get the answer. Please help.