Skip to content

pol2cart

general · scripts/general/pol2cart.m

: [x, y] = pol2cart (theta, rho)
: [x, y, z] = pol2cart (theta, rho, z)
: P = pol2cart (…)

Convert polar or cylindrical coordinates to Cartesian coordinates.

x = rho .* cos (theta) and y = rho .* sin (theta); z is passed through. The inputs must be real floating point arrays of the same size, or scalars. With a single output the result is the matrix [x(:), y(:)] (plus z(:) when three inputs are given).

A single matrix argument with two or three columns is also accepted; its rows are the points.