Points on a sphere - how to get the third angle

111 Views Asked by At

So by the equation of a sphere

$x = x_0 + r\cdot\sin\theta\cos\phi$

$y = y_0 + r\cdot\sin\theta\sin\phi$

$z = z_0 + r\cdot\cos\theta$

I can get the three coordinates from two angles and I can get the two angles from the coordinates. However, how do I get the third angle (that I think goes around the $x$-axis)?

EDIT

Can I simply say that the angle between $z$ and $y$ comes from

$z=z_0+r\cos\varphi$

$y = y_0 + r\sin\varphi$

and do $\varphi = \cos^{-1}\frac{z-z_0}{r}$?

1

There are 1 best solutions below

3
On

The coordinates as you described them don't really naturally have a third angle. Because the plane in which the $\phi$ is chosen already depends on the $\theta$-angle. As you can see in this image from Wikipedia:

enter image description here

What you could do is just expand on the idea of $\theta$ which is the angle around the z-axis with the formula: $\theta = arctan(y/x)$. This gives a simple idea for the rest, the angle around the y-axis is $arctan(x/z)$ and around the x-axis is $arccos(z/y)$.

This is the main idea, depending on the orientation you chose, you'll probably have to invert some of the fractions, but this should be the gist of it.

I know this is all somewhat handwavy, but I think Euler angles might be what you are looking for.