Reference · The <chikyu-space> element
BodyInfotype
What a page can tell a reader about a body now.
Import it
import type { BodyInfo } from "@johnmorrisdotca/chikyu-earth/space/element";
Definition
interface BodyInfo {
name: BodyName;
radiusKm: number;
distanceKm: number;
}
Members
| Name | Type | Description |
|---|---|---|
name | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | "Earth" | "Sun" | "Moon" | |
radiusKm | number | Mean radius, kilometres. |
distanceKm | number | Distance from the Earth's centre now, kilometres (0 for the Earth). |
Examples
import type { BodyInfo } from "@johnmorrisdotca/chikyu-earth/space/element";
const info: BodyInfo = { name: "Mars", radiusKm: 3389.5, distanceKm: 225_000_000 };
console.log(`${info.name}: ${info.radiusKm} km`);