Skip to main content

scoord

Function scoord 

Source
pub unsafe extern "C" fn scoord(
    px: *const c_double,
    py: *const c_double,
    pz: *const c_double,
    plat: *mut c_double,
    plon: *mut c_double,
    pnrm: *mut c_double,
)
Expand description

Converts from Cartesian to spherical coordinates (latitude, longitude, radius).

§Arguments

  • px, py, pz - Input. The coordinates of p
  • plat - Output. The latitude of p in the range -PI/2 to PI/2, or 0 if pnrm = 0.
  • plon - Output. The longitude of p in the range -PI to PI, or 0 if p lies on the Z-axis.
  • pnrm - Output. The magnitude (Euclidean norm) of p.

§Safety

  • All pointers must be valid and properly aligned