cart2pol
Convert cartesian coordinates to polar/cylindrical
Syntax
[theta, rho] = cart2pol(x, y) [theta, rho, ZZ] = cart2pol(x, y, z)
Arguments
- x
Cartesian X-coordinate. Must have the same size as
y.- y
Cartesian Y-coordinates. Must have the same size as
x.- z
Cartesian Z-coordinates. Must be a scalar or have the same size as
x.- theta
Angular coordinate relative to the X-axis.
- rho
Radial coordinate (distance to pole).
- ZZ
Elevation coordinate.
Description
For real scalars, vectors or matrices x and y (Cartesian coordinates), cart2pol(x, y) returns polar theta and rho coordinates.
For real scalars, vectors or matrices x, y and z (Cartesian coordinates), cart2pol(x, y, z) returns cylindrical theta, rho and ZZ coordinates. If z is a scalar then ZZ is expanded to the same size as x.
Examples
x = 1:5; y = [1 5 3 6 8]; [theta, rho] = cart2pol(x, y) z = 5:9; [theta, rho, ZZ] = cart2pol(x, y, z)
See also
- pol2cart — Convert polar/cylindrical coordinates to cartesian
- polarplot — Plot polar coordinates
- graypolarplot — Polar 2D plot of a surface using colors
History
| Version | Description |
| 2025.1.0 | Introduction in Scilab. |
| Report an issue | ||
| << Conversions | Conversions | pol2cart >> |