1. Determine the equation of the line-segment:
Re-write this equation into the form
2. If the circle touches the line the center of the circle has the distance r from the line. The distance of a point P(p, q) from the line is calculated by:
(You see here why it is essential that you transform the equation of the line)
3. Obviously the center of the circle is moving on straight line too such that the y-coordinate of the center is a constant. Set d = r and solve for the x-coordinate of the new center.
4. You'll get 2 different circles which satisfy the given conditions.