NNSOM.utils.cart2pol

NNSOM.utils.cart2pol(x, y)[source]

Convert Cartesian coordinates to polar coordinates.

Parameters:
  • x (float or np.ndarray) – X-coordinate(s).

  • y (float or np.ndarray) – Y-coordinate(s).

Returns:

  • theta (float or np.ndarray) – Angle in radians, measured counter-clockwise from the positive x-axis (output of np.arctan2).

  • rho (float or np.ndarray) – Radial distance(s) from the origin.