Navigation

Operators and Keywords

Function List:

C++ API

: [x, y, z] = sph2cart (theta, phi, r)
: [x, y, z] = sph2cart (S)
: C = sph2cart (…)

Transform spherical coordinates to Cartesian coordinates.

The inputs theta, phi, and r must be the same shape, or scalar. If called with a single matrix argument then each row of S represents the spherical coordinate (theta, phi, r).

theta describes the angle relative to the positive x-axis.

phi is the angle relative to the xy-plane.

r is the distance to the origin (0, 0, 0).

If only a single return argument is requested then return a matrix C where each row represents one Cartesian coordinate (x, y, z).

See also: cart2sph, pol2cart, cart2pol.

Package: octave