Reference · Where the Sun, Moon and planets are for a date, in two scales, with the camera maths
radiusInfunction
A body's radius in Earth radii: the real one, or one large enough to see in a compressed view.
Import it
import { radiusIn } from "@johnmorrisdotca/wakusei-planets/space";
Definition
function radiusIn(id: "sun" | "earth" | "moon" | SpacePlanet, mode: ScaleMode): number
Parameters
| Name | Type | Description |
|---|---|---|
id | "sun" | "mercury" | "venus" | "earth" | "mars" | "jupiter" | "saturn" | "uranus" | "neptune" | "pluto" | "moon" | The Sun, the Earth, the Moon or a planet. |
mode | ScaleMode | The scale. |
Returns
number
The radius to draw it at, in Earth radii.
Examples
import { radiusIn } from "@johnmorrisdotca/wakusei-planets/space";
console.log(radiusIn("moon", "true").toFixed(3), radiusIn("moon", "compressed"));0.272 0.9What it prints (run when this page was built)