Documentation / @interstellar-tools/equations / planetocentricLatitude
Function: planetocentricLatitude()
ts
function planetocentricLatitude(x: number, y: number, z: number): number;Defined in: cartography/planetocentric-latitude.ts:37
Compute planetocentric latitude (
Planetocentric latitude is defined as the angle between the body's equatorial plane and the radius vector from the body's center of mass to the point:
Implementation note:
- This uses
atan2(z, hypot(x,y))for numerical stability and correct quadrant handling.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate in a body-fixed frame (finite). |
y | number | Y coordinate in a body-fixed frame (finite). |
z | number | Z coordinate in a body-fixed frame (finite). |
Returns
number
Planetocentric latitude (
Throws
If any input is not a finite number.
Example
ts
// Point directly above the equator on +X axis:
const phi = planetocentricLatitude(1, 0, 0);
// phi === 0
// Point on +Z axis:
const northPole = planetocentricLatitude(0, 0, 1);
// northPole === Math.PI / 2See
- https://en.wikipedia.org/wiki/Planetary_coordinate_system Planetary coordinate system (definitions of planetocentric vs. planetographic latitude)
- https://planetarynames.wr.usgs.gov/Page/Website USGS Planetary Names (planetocentric latitude definition)
- https://pds.nasa.gov/datastandards/pds3/standards/sr/Chapter02.pdf NASA PDS Standards Reference (planetocentric latitude defined as angle to the center-of-mass vector)
- https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pdf/individual_docs/17_frames_and_coordinate_systems.pdf NAIF SPICE tutorial: Frames and Coordinate Systems (planetocentric/body-fixed frame conventions)