Coordinates of circle center on a line through a point touching other circle

circlesgeometrytrigonometry

I need to make a part of a program in java that calculates a circle center. It has to be a circle through a given point that touches another circle, and the variable circle center has the possibility to move over a given line.

Example of the problem

Here the coordinates of A, B and C and the radius of the circle around A are given. I need to know how to get the coordinates of P and P' when they touch the blue circle around A.

Best Answer

Geometric solution

Locus of points equidistant to a circle and a point (outside the circle) is a hyperbola.
These equidistant points are centers of circles through the given point, and touching the given circle.

enter image description here

In the present case, the given blue circle is denoted $\gamma$ and is centered at $A.$ The hyperbola has foci $A$ and $B$ and passes through the middle point of the segment $BG,$ where $G$ is intersection of $AB$ and $\gamma.$
Since the centers of circles touching $\gamma$ must lie at $BC,$ they are at the intersection of $BC$ and the hyperbola.

The picture gives two possible configurations assuming that $BC$ has empty intersection with the circle:

  1. the line cuts each branch of the hyperbola at a single point
  2. the line cuts one branch of hyperbola at two points

(analytic solution can be added à la commande)

Related Question