Reference · Pure coordinate conversions
sphericalToCartesianfunction
Convert spherical to Cartesian, preserving origin, frame, epoch and geometric corrections. Radius must be positive.
Import it
import { sphericalToCartesian } from "@johnmorrisdotca/wakusei-planets/coordinates";
Definition
function sphericalToCartesian(value: SphericalAu): CartesianAu
Parameters
| Name | Type | Description |
|---|---|---|
value | SphericalAu | Coordinates with explicit origin, frame, epoch and geometric corrections. |
Returns
CartesianAu
Cartesian components in AU with the same context.
Examples
import { sphericalToCartesian } from "@johnmorrisdotca/wakusei-planets/coordinates";
console.log(sphericalToCartesian({ origin: "heliocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", longitude: 90, latitude: 0, distanceAu: 1 }));{
origin: 'heliocentric',
frame: 'eclipticJ2000',
epoch: 'J2000',
corrections: 'geometric',
xAu: 6.123233995736766e-17,
yAu: 1,
zAu: 0
}What it prints (run when this page was built)