openlifu.geo.cartesian_to_spherical¶
- openlifu.geo.cartesian_to_spherical(x: float, y: float, z: float) Tuple[float, float, float][source]¶
Convert cartesian coordinates to spherical coordinates
Args: x, y, z are cartesian coordinates Returns: r, theta, phi, where
r is the radial spherical coordinate, a nonnegative float. theta is the polar spherical coordinate, aka the angle off the z-axis, aka the non-azimuthal spherical angle.
theta is in the range [0,pi].
phi is the azimuthal spherical coordinate, in the range [-pi,pi]
Angles are in radians.