Reference · The Sun, Moon and planets: pure parts
SatelliteScreentype
Where a satellite is on the screen now: in CSS pixels from the view's top left (which may lie outside the box), whether it can be seen, which edge it lies beyond, whether it is behind the camera, whether the Earth hides it, and how high it is.
Import it
import type { SatelliteScreen } from "@johnmorrisdotca/chikyu-earth/space";
Definition
interface SatelliteScreen {
x: number;
y: number;
visible: boolean;
heightKm: number;
edge: ScreenEdge | null;
behind: boolean;
occluded: boolean;
estimated: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
visible | boolean | Inside the box, in front of the camera and not hidden by the Earth. |
heightKm | number | Height above the mean Earth radius, in kilometres, at the moment drawn. |
edge | ScreenEdge | null | The edge the satellite lies beyond, or |
behind | boolean | The satellite is behind the camera. The picture would put it on the opposite side, so |
occluded | boolean | The Earth hides the satellite: the line from the camera meets the globe before the satellite. False at the limb, in front, and when the satellite is only behind the camera. |
estimated | boolean | Its place is an estimate ( |
Examples
import type { SatelliteScreen } from "@johnmorrisdotca/chikyu-earth/space";
const seen = (place: SatelliteScreen | null): boolean => place !== null && place.visible;
console.log(typeof seen);functionWhat it prints (run when this page was built)