Equation for making a circle in 3D space

8.1k Views Asked by At

I have a 3D space with axis $(x, y ,z)$ and I can make a circle in the $xy$-plane.

To make a circle in the xy-plane I currently use spherical coordinates $(r, \theta, \phi)$ where $r = 1$, $\theta = \pi/2$, and $\phi = [0, 2\pi]$ and this is converted to Cartesian coordinates $(x, y, z)$ using the equations:

$x = r\sin\theta$ $\cos\phi$

$y = r\sin\theta$ $\sin\phi$

$z = r\sin\theta$

How do I tile this circle around the y-axis ? so it can circle on any plane starting from the xy-plane to the zy-plane. I hope this all makes sense.

1

There are 1 best solutions below

1
On BEST ANSWER

You can simply rotate your setup: let $\phi\in[0,2\pi]$ parametrize your circle like you did, but use $\theta\in[0,\frac\pi2]$ to describe the rotation of your plane. Then you can use

\begin{align*} x &= r\cos\phi\cos\theta \\ y &= r\sin\phi \\ z &= r\cos\phi\sin\theta \end{align*}

For $\theta=0$ this gives a circle in the $xy$ plane, and for $\theta=\frac\pi2$ the circle lies in the $zy$ plane.