Rotating a cone

algebra-precalculuscalculuseuclidean-geometrygeometrylinear algebra

I learned that, given a point $(x,y)$ in the plane, $\sigma_{\phi}(x,y) = (x\cos(\phi)-y\sin(phi),x\sin(\phi)+x\cos(\phi))$ is the point corresponding to rotating $(x,y)$ by an angle $\phi$ counter-clockwise. This can be used for finding the equation of a rotated parabola, for example. I thought about the formula and realized that, writing $(x,y)$ in polar form $(r\cos(\varphi), r\sin(\varphi))$, it is clear that the rotated point is $(r\cos(\varphi+\phi)), r\sin(\varphi+\phi)$. Applying the formulas for the sine and the cosine of the sum of two angles, I obtained the expression of $\sigma_{\phi}(x,y)$.

EDIT: the inspiration of this questions is that I'd like to rotate a cone so its axis becomes another line (for example, so a 'tilted cone' becomes a vertical one). Hence the title of the question.

Now, I'd like to know how to rotate a figure in space so that the $z$ axis becomes a certain line of my election. I thought that using spherical coordinates would be the natural approach. I spherical coordinates,
$$x = r\sin(\phi)\cos(\theta)\\
y = r\sin(\phi)\sin(\theta)\\
z = r\cos(\phi)
$$

being $\theta$ the polar angle and $\phi$ the angle with the $z$ axis. In my case, I want to add $\phi_0$ to the angle $\phi$. Applying the formulas of the sine and cosine of the sum of angles, I got that the point $(x',y',z')$ corresponding to rotating a point $(x,y,z)$ is
$$
x' = x\cos(\phi_0)+z\sin(\phi_0)\cos(\theta) \\
y' = y\cos(\phi_0)+z\sin(\phi_0)\sin(\theta)\\
z' = z\cos(\phi_0)-r\sin(phi_1)\sin(\phi)
$$

The angles $\theta$ and $\phi$ should be found from $(x,y,z)$. Is my approach correct? Is there an easier way to do this? I would really appreciate if someone could point me in the right direction.

Best Answer

The equation of a circular cone is determined by two things: It's axis represented by the unit vector $\mathbf{a}$, and the semi-vertical angle which is the angle $\theta$ ​between the axis and the curved surface.

A point $\mathbf{r} = [x, y, z]^T $ is on the surface of the cone if

$ \mathbf{r}^T \mathbf{a} = \cos \theta \sqrt{ \mathbf{r}^T \mathbf{r} } $

Squaring both sides

$ \mathbf{r}^T \mathbf{a} \mathbf{a}^T \mathbf{r} = \cos^2 \theta \mathbf{r}^T \mathbf{r} $

which can be written as

$ \mathbf{r}^T \left( \cos^2 \theta I_3 - \mathbf{a} \mathbf{a}^T \right) \mathbf{r} = 0 $

And this is the equation of the cone for any orientation of the axis $\mathbf{a}$.

In spherical coordinates:

$ \mathbf{a} = \begin{bmatrix} \sin \phi \cos \psi \\ \sin \phi \sin \psi \\ \cos \phi \end{bmatrix} $

To generate the new axis just plug in the new values for $\phi$ and $\psi$.