Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.1.0 - English


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

VersionDescription
2025.1.0 Introduction in Scilab.
Report an issue
<< Conversions Conversions pol2cart >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 22 12:50:58 CEST 2025