# Angles of a known 3d vector

I have a 3d vector r known by its coordinates rx, ry, rz. How can calculate angles Theta and Phi ?

• $\varphi = \arctan(y/x)$ and $\theta = \arccos(z/r)$. Apr 22 '17 at 20:05
• Thanks ! I have a cube at pos (0,0,0) whose x-axis I want to orient in the same direction than r, by what coordinates should I rotate the cube (maya software) ? (0,φ,θ) ? Apr 22 '17 at 20:17