# Parametric equation of a circle in 3 space - odd result

I have the following problem involving parameterized circular equations, but am getting strange answers and wanted to check if my approach made any sense. In 3D space, the parametric equation of a circle is given by

$\vec r(t) = \vec c + r \cos(t) \vec u + r \sin(t) \vec n \times \vec u$

where $\vec c$ is the centre, $r$ the radius, $\vec u$ a unit vector along the radius and $\vec n$ a unit vector normal to the circle. There's a line $L$ running through this circle which I know the equation of:

$L: A\vec x + B \vec y + C \vec z$

I want to find any point on the circle a perpendicular distance of $r$ from the line $L$. One approach I thought should work was to specify this point as $p = p_{x}\vec x + p_{y} \vec y + p_{z} \vec z$, and then specify the unit vectors to the circle $\vec u$ and $\vec n$ by

$\vec u = \frac{1}{r}\left( (p_{x} - c_{x})\vec x + (p_{y} - c_{y}) \vec y + (p_{z} - c_{z}) \vec z \right)$

$\vec n = \frac{1}{N}\left( A\vec x + B \vec y + C \vec z \right)$

where $N = \sqrt{A^2 + B^2 + C^2}$. With this, I should be able to parameterize the circle. However, I'm getting something off when I try to find a point on it; by my understanding I should be able to set $t$ as anything from 0 to $2 \pi$ and this should correspond to a point on the circle. If you test this at $t = 0$, you get a nice tautological (but true) statement that $p_{x} = p_{x}$ etc. I tried to find this at $t = \pi /2$, which gave me three equations for the elements of $\vec p$ as expected -

$p_{x} = c_{x} + \frac{1}{N}\left(B(p_{z} - c_{z}) - C(p_{y} - c_{y}) \right)$

$p_{y} = c_{y} + \frac{1}{N}\left(C(p_{x} - c_{x}) - A(p_{z} - c_{z}) \right)$

$p_{z} = c_{z} + \frac{1}{N}\left(A(p_{y} - c_{y}) - B(p_{x} - c_{x}) \right)$

However, the trivial solution to these equations are simply $\vec{p} = \vec{c}$ which can't be correct, as a point a distance $r$ from the centre can't be on the centre! Is there another set of unique solutions or have I made a mistake in my logic? Thought I'd check before I devote any more time to chasing potentially wrong solutions - very grateful for any suggestions.

• I did not look into the details but there seems to be a problem with your equation since the normal unit is used only with the sin and not with the cosin – Moti Mar 14 '15 at 20:40
• Sorry I'm not quite sure what you mean here? – DRG Mar 14 '15 at 20:49
• In your first equation it looks like the n unit vector is missing in the first term. – Moti Mar 14 '15 at 20:53
• No, the circle is parameterised by two vectors in the plane; the normal vector is crossed with the plane (n x u) to find another normal to u; demonstrations.wolfram.com/ParametricEquationOfACircleIn3D – DRG Mar 14 '15 at 20:55

I think I may have been able to answer this question myself; the equation established holds, but it's linearly dependent on other terms in the equation so you'd need more information to establish an identity. You could exploit the fact that $|r - c| . L = 0$ and combine this with the fact that $|r(t) - c| = r$ to set up a series of equations, but even dumping this into mathematica and leaving it run all weekend with assumptions still doesn't yield an answer, I'd wager due to degeneracy in the solutions.
To circumvent this, I found an easier approach; simply re-cast the problem as a double rotational transform. So starting with $\vec c$ as a centre of rotation, I rotate a point a distance of r away from this by a polar angle of $\theta$ and an azimuth angle of $\phi$, which can both be readily obtained from the line equation. After some simple manipulation, you can a nice expression for the transform of this point perpendicular to the line a distance $r$ away from it, avoiding all the mucking about with parameters. If anyone needs details I'm happy to provide them, hope this helps.