topolar#

Purpose#

Converts from Cartesian to polar coordinates.

Format#

{ r, theta } = topolar(xy)#
Parameters:

xy (complex matrix) – NxK complex matrix containing the x coordinate in the real part and the y coordinate in the imaginary part

Returns:
  • r (NxK real matrix) – radius.

  • theta (NxK real matrix) – angle in radians.

Examples#

// Create a Cartesian point (x=3, y=4)
// as a complex number
xy = complex(3, 4);

{ r, theta } = topolar(xy);
print r;
print theta;

The code above produces the following output:

5.0000000
0.92729522

Source#

coord.src

See also

Functions tocart()