tocart#

Purpose#

Converts from polar to Cartesian coordinates.

Format#

xy = tocart(r, theta)#
Parameters:
  • r (NxK real matrix) – radius.data

  • theta (LxM real matrix) – ExE conformable with r, angle in radians.

Returns:

xy (max(N,L) by max(K,M) complex matrix) – containing the x coordinate in the real part and the y coordinate in the imaginary part.

Examples#

// Convert polar coordinates (r=5, theta=pi/4)
// to Cartesian coordinates
r = 5;
theta = pi / 4;
xy = tocart(r, theta);
print xy;

The code above produces the following output:

3.5355339 + 3.5355339i

The real part is the x coordinate and the imaginary part is the y coordinate.

Source#

coord.src

See also

Functions topolar()