Skip to main content

Module spherical

Module spherical 

Source

Structs§

SphericalCoord
Spherical coordinate with polar angle theta (from +Z) and azimuthal angle phi (from +X in XY).
SphericalGrid
A grid of points distributed on a sphere, useful for rendering.

Functions§

fibonacci_sphere
Generate n approximately evenly distributed points on a unit sphere using the Fibonacci spiral.
from_cartesian
Convert a Cartesian position to spherical coordinates. The radius is implicitly the length of the vector.
geodesic
Compute a geodesic (great circle arc) between two spherical coordinates. Returns steps points on the unit sphere as Vec3.
great_circle_distance
Great-circle distance between two points on a unit sphere. Uses the Vincenty formula for numerical stability.
inverse_stereographic
Inverse stereographic projection from the plane back to the unit sphere.
spherical_triangle_area
Area of a spherical triangle on a unit sphere using spherical excess. Girard’s theorem: Area = E = A + B + C - PI where A, B, C are the interior angles.
stereographic_projection
Stereographic projection from a unit sphere to the plane. Projects from the north pole (0,0,1) onto the z=0 plane. point3d should lie on the unit sphere.
to_cartesian
Convert spherical coordinates to Cartesian (x, y, z) on a sphere of given radius.