Reference · The realistic Earth's pure parts
cameraCentrefunction
The place the camera looks at for a moment: the home centre as it is (ground), the home centre as it was when the camera was set, carried west by the Earth's turn since (space), or the home centre read from the Sun's own place (sun: 0,0 is straight at noon).
It sets cameraSpin when the space camera has none yet. Pure apart from that.
Import it
import { cameraCentre } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function cameraCentre(model: Pick<EarthModel, "centre" | "camera" | "cameraSpin" | "time">): GeoPoint
Parameters
| Name | Type | Description |
|---|---|---|
model | Pick<EarthModel, "time" | "centre" | "camera" | "cameraSpin"> | The model: its centre, camera, camera spin and the moment shown. |
Returns
GeoPoint
The longitude and latitude the view is turned from (yaw and tilt are added to it by lookAt).
Examples
import { cameraCentre } from "@johnmorrisdotca/chikyu-earth/realistic";
const start = Date.UTC(2026, 10, 2, 12);
const model = { centre: { lon: 10, lat: 30 }, camera: "space" as const, cameraSpin: null, time: start };
cameraCentre(model);
model.time = start + 6 * 3_600_000;
console.log(cameraCentre(model).lon.toFixed(1));-80.2What it prints (run when this page was built)