xy2polar#
- ktch.harmonic.xy2polar(xy: npt.NDArray[np.float64], *, centered: bool = True) npt.NDArray[np.float64][source]#
Convert Cartesian coordinates to polar coordinates on the unit disk.
- Parameters:
- xyndarray of shape (N, 2)
Cartesian coordinates. If
centered=True(default), assumed in[-1, 1] x [-1, 1]. Ifcentered=False, assumed in[0, 1] x [0, 1].- centeredbool, default=True
Whether the input is already centered at the origin.
- Returns:
- ndarray of shape (N, 2)
Polar coordinates
[r, theta]whereris in[0, 1]andthetais in[0, 2*pi).