Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Transform Cartesian coordinates to spherical

```
[azimuth,elevation,r]
= cart2sph(x,y,z)
```

The mapping from three-dimensional Cartesian coordinates to spherical coordinates is

azimuth = atan2(y,x) elevation = atan2(z,sqrt(x.^2 + y.^2)) r = sqrt(x.^2 + y.^2 + z.^2)

The notation for spherical coordinates is not standard. For
the `cart2sph`

function, `elevation`

is
measured from the *x-y* plane. Notice that if ```
elevation
= 0
```

, the point is in the *x-y* plane.
If `elevation = pi/2`

, then the point is on the positive *z*-axis.

Was this topic helpful?