Cartesian to Spherical
Cartesian coordinates to spherical coordinates
Libraries:
Simulink Extras /
Transformations
Description
The Cartesian to Spherical block transforms the Cartesian coordinates (x, y, z) to the spherical coordinates (r, theta, phi).
The first input is x, the second input is y, and the third input is z. The first output is r, the second output is theta, and the third output is phi. The angles theta and phi are in radians.
The Cartesian coordinates (x, y, z) describe a point P with respect to the x-axis, y-axis, and z-axis. The spherical coordinate r is the length of the line from the origin to the point P. The spherical coordinate theta (the azimuth) is the angle measured in radians from the positive x-axis to the projection, in the x-y plane, of the line from the origin to P. The spherical coordinate phi (the zenith) is the angle, measured in radians, from the positive z-axis to the line from the origin to P.
Note
The MATLAB® function cart2sph
measures phi from
the x-y plane.
Note
The notation for spherical coordinates might differ in other references. Sometimes, the order of theta and phi is reversed. Sometimes, theta denotes the zenith and phi denotes the azimuth.
Ports
Input
Output
Version History
Introduced in R2008b