Given the Cartesian coordinates of any point $p$ on the surface of a sphere in $\Bbb R ^3$, how do I calculate the angles between each axis $(x, y, z)$ and the vector $n$ defined by origin $o$ and $p$.
For convenience sake I'll say that origin $o$ equals $(0,0,0)$ so that $n = p$
I begun my attempt by calculating the direction cosines, but now that I want to calculate the angles using inverse cosines, I realize that a sphere has eight octants and that cosines have 2 angles in some of them.
Is there a more elegant way to solve this? And if so, how do I approach this?