Converting between Cartesian and spherical coordinates in 3-space

754 Views Asked by At

Converting between $(x,y,z)$ to $(\rho , \theta, \phi)$. What is the formula for finding $\phi$? My book says $\phi = \arccos (\frac{z}{\sqrt{x^2 + y^2 + z^2}}$). However, Wolfram says the formula is $\phi = \arccos (\frac{z}{r}$) where $r= \sqrt{x^2 + y^2}$. So, which formula is right? If I were to convert cartesian $(1,1,1)$ to spherical would $ \phi = \arccos( \frac{1}{ \sqrt{3} }) $? Checking on Wolfram, converting from cartesian(1,1,1) to spherical ($\rho, \theta, \phi$) I get $\phi = \frac{\pi}{4}$. If $\phi=arccos\frac{z}{\rho}$ then how is $\phi = \frac{\pi}{4}$

2

There are 2 best solutions below

0
On BEST ANSWER

enter image description here

$$\rho^2=x^2+y^2+z^2$$ $$\phi = \arccos \frac{z}{\rho}$$

0
On

When computing $\phi$ the radius in the denominator of the arccosinus is the radius of the sphere, so $r=\sqrt{x^2+y^2+z^2}$. Even on the Wolfram site you have the correct answer (http://mathworld.wolfram.com/SphericalCoordinates.html).