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


pol2cart

Convert polar/cylindrical coordinates to cartesian

Syntax

[XX, YY] = pol2cart(theta, rho)
[XX, YY, ZZ] = pol2cart(theta, rho, z)

Arguments

theta

Angular coordinate relative to the X-axis. Must have the same size as rho.

rho

Radial coordinate (distance to pole). Must have the same size as theta.

z

Elevation coordinate. Must be a scalar or have the same size as theta.

XX, YY, ZZ

Cartesian coordinates.

Description

For real scalars, vectors or matrices theta and rho (polar coordinates), pol2cart(theta, rho) returns Cartesian XX and YY coordinates. For real scalars, vectors or matrices theta, rho and z (cylindrical coordinates), pol2cart(theta, rho, z) returns Cartesian XX, YY and ZZ coordinates. If z is a scalar then ZZ is expanded to the same size as theta.

Examples

theta = 0:%pi/2:%pi;
rho = [2 4 6];
[x, y] = pol2cart(theta, rho)

z = 5:7;
[XX, YY, ZZ] = pol2cart(theta, rho, z)

See also

  • cart2pol — Convert cartesian coordinates to polar/cylindrical
  • polarplot — Plot polar coordinates
  • graypolarplot — Polar 2D plot of a surface using colors

History

VersionDescription
2025.1.0 Introduction in Scilab.
Report an issue
<< cart2pol Conversions Matrix-wise processing >>

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