MATLAB Function Reference
  Go to function:
    Search    Help Desk 
cart2sph    See Also

Transform Cartesian coordinates to spherical

Syntax

Description

[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.

Algorithm

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


See Also

cart2pol    Transform Cartesian coordinates to polar or cylindrical

pol2cart    Transform polar or cylindrical coordinates to Cartesian

sph2cart    Transform spherical coordinates to Cartesian



[ Previous | Help Desk | Next ]