cart2sph
Transform Cartesian coordinates to spherical
Syntax
[azimuth,elevation,r] = cart2sph(x,y,z)
Description
Examples
Input Arguments
Output Arguments
Algorithms
The mapping from three-dimensional Cartesian coordinates to spherical coordinates is
方位= 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 thecart2sph
function,elevation
is measured from thex-yplane. Notice that ifelevation = 0
, the point is in thex-yplane. Ifelevation = pi/2
, then the point is on the positivez-axis.
Extended Capabilities
Introduced before R2006a
Was this topic helpful?