pol2cart

Converts polar or cylindrical coordinates to Cartesian.

Syntax

[x,y]=pol2cart(theta,r)

[x,y,z]=pol2cart(theta,r,z)

[x,y]=pol2cart(P)

[x,y,z]=pol2cart(P)

C = pol2cart(...)

Inputs

theta,r,z
Polar coordinates.
Type: double
Dimension: scalar | string | vector | matrix
P
An array or matrix containing polar or cylindrical coordinates.
Type: double
Dimension: vector | matrix

Outputs

x,y,z
Cartesian coordinates.
C
An array or matrix containing Cartesian corrdinates.
Type: double
Dimension: vector | matrix

Examples

Single return pol2cart polar example:
C=pol2cart(pi/3,2)
C = [Matrix] 1 x 2
1.00000  1.73205
Multiple return pol2cart cylindrical example:
[x,y,z]=pol2cart(pi/6,3,4)
x = 2.59807621
y = 1.5
z = 4

Comments

When a matrix contains multiple points the coordinates are stored by row.