<< Conversions Conversions pol2cart >>

Scilab Help >> Funções Elementares > Trigonometria > Conversions > cart2pol

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

History

VersionDescription
2025.1.0 Introduction in Scilab.

Report an issue
<< Conversions Conversions pol2cart >>