Expand description
Spherical coordinate transformations
This module provides functions for transforming between Cartesian and spherical coordinate systems, as well as utilities for working with spherical coordinates.
Spherical coordinates use the following convention:
- r (radius): Distance from the origin to the point
- theta (polar angle): Angle from the positive z-axis (0 to π)
- phi (azimuthal angle): Angle from the positive x-axis in the xy-plane (0 to 2π)
Note: This convention (r, theta, phi) is used in physics. In mathematics, the convention (r, phi, theta) is sometimes used. We follow the physics convention.
Functions§
- cart_
to_ spherical - Converts Cartesian coordinates (x, y, z) to spherical coordinates (r, theta, phi)
- cart_
to_ spherical_ batch - Converts multiple Cartesian coordinates to spherical coordinates
- geodesic_
distance - Calculates the geodesic distance between two points on a sphere
- spherical_
to_ cart - Converts spherical coordinates (r, theta, phi) to Cartesian coordinates (x, y, z)
- spherical_
to_ cart_ batch - Converts multiple spherical coordinates to Cartesian coordinates
- spherical_
triangle_ area - Calculates the area of a spherical triangle given by three points on a unit sphere