Given two circles and an external point P in 3D space, I want to find the line in which passes through point P and also through the perimeters of both circles. The circles are parallell and concentric but offset in height, as on a cone. (Whether there exists none, one, two or infinite solutions depend on the positions of P and the circles. We can assume that there exist two solutions.)

This is how I have started out:

- The point P outside of the circles has the known coordinates

{xP; zP; yP}

- With the parametric equation for a circle, the point on circle one, C1, has the coordinates

{x1=r1*Cos[alpha1]; z1=r1*Sin[alpha1]; y1}

where r1 is the radius of circle one and alfa1 is the origo-angular position of point C1.

- Correspondingly for the point on the other circle, C2. The heights of the circles are independent of the angular parameter alpha, and are y1 and y2 respectively.

But thenhow do I find the conditions for when these three points line up?

I've actually used the law of cosinus to formulate the angle C1'P'C2 at point P as a function of alpha1 and alpha2 in order to minimize it numerically. However, this is cumbersome and I'm sure there are far simpler and better approaches.

I'm grateful for any assistance!