Version:

Last Modified: January 9, 2017

Transforms 2D or 3D Cartesian coordinates into polar or cylindrical data, respectively. cart_to_polar performs an element-wise transformation for arrays.

[a, b] = cart_to_polar(x, y)

[a, b, c] = cart_to_polar(x, y, z)Legacy name: cart2pol

X-coordinates. x is a scalar or an array of any dimension of floating-point or real numbers. If x, y, and z are not scalars, they must have the same shape.

Y-coordinates. y is a scalar or an array of any dimension of floating-point or real numbers. If x, y, and z are not scalars, they must have the same shape.

Z-coordinates. z is a scalar or an array of any dimension of floating-point or real numbers. If x, y, and z are not scalars, they must have the same shape.

Angles of the polar or cylindrical data. a is an array of the same size as the maximum shape of x, y, and z.

Radii of the polar or cylindrical data. b is an array of the same size as the maximum shape of x, y, and z.

Heights of the cylindrical data. c is an array of the same size as the maximum shape of x, y, and z.

If you provide 2D coordinates, MathScript performs the transformation using the following equations:

a = atan2(y, x)

b = sqrt(x. ^2+y.^2)

If you provide 3D coordinates, MathScript performs the transformation using the following equations:

a = atan2(y, x)

b = sqrt(x.^2+y.^2)

c = z

[A, B, C] = cart_to_polar(1, 1, 1)

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported