MATLAB Function Reference | Search  Help Desk |
cart2sph | See Also |
Transform Cartesian coordinates to spherical
[THETA,PHI,R] = cart2sph(X,Y,Z)
[THETA,PHI,R] = cart2sph(X,Y,Z)
transforms Cartesian coordinates stored in corresponding elements of arrays X
, Y
, and Z
into spherical coordinates. Azimuth THETA
and elevation PHI
are angular displacements in radians measured from the positive x-axis, and the x-y plane, respectively; and R
is the distance from the origin to a point.
Arrays X
, Y
, and Z
must be the same size.
The mapping from three-dimensional Cartesian coordinates to spherical coordinates is:cart2pol
Transform Cartesian coordinates to polar or cylindrical
pol2cart
Transform polar or cylindrical coordinates to Cartesian
sph2cart
Transform spherical coordinates to Cartesian