Main Content

Cartesian to Polar

Cartesian coordinates to polar coordinates

  • Cartesian to Polar block

Libraries:
Simulink Extras / Transformations

Description

The Cartesian to Polar block transforms Cartesian coordinates (x, y) to polar coordinates (r, theta).

The first and second inputs correspond to x and y, respectively. The first and second outputs correspond to r and theta, respectively. The angle theta is in radians.

The Cartesian coordinates (x, y) describe a point with respect to the x-axis and the y-axis. The polar coordinates (r, theta) describe the same point where r is the distance from the origin and theta is the counterclockwise angle in radians from the positive x-axis.

r=x2+y2theta=arctan(yx)

Ports

Input

expand all

Input signal specifying the x value in the cartesian coordinates (x,y). Both inputs must be real scalars of the same data type.

Data Types: single | double

Input signal specifying the y value in the Cartesian coordinates (x,y). Both inputs must be real scalars of the same data type.

Data Types: single | double

Output

expand all

Output signal specifying the r coordinate of the Polar coordinates (r,theta).

Data Types: single | double

Output signal specifying the theta coordinate of the Polar coordinates (r,theta).

Data Types: single | double

Version History

Introduced in R2008b