Reference · The globe as an SVG string
rotationAtfunction
The rotation at now for a globe that was centred on centre at start. The tilt stays; the spin advances at the
Earth's own rate, so the disc turns as the real Earth does and the centred place drifts with it.
Import it
import { rotationAt } from "@johnmorrisdotca/chikyu-earth";
Definition
function rotationAt(centre: GeoPoint, now: number, start: number): Rotation
Parameters
| Name | Type | Description |
|---|---|---|
centre | GeoPoint | The place the globe was centred on at |
now | number | The time to draw for, in milliseconds. |
start | number | The time the globe was centred, in the same milliseconds as |
Returns
Rotation
The [lambda, phi] rotation at now.
Examples
import { rotationAt, SIDEREAL_DAY_MS } from "@johnmorrisdotca/chikyu-earth";
const tokyo = { lon: 139.7, lat: 35.7 };
console.log(rotationAt(tokyo, SIDEREAL_DAY_MS / 2, 0));[ 40.30000000000001, -35.7 ]What it prints (run when this page was built)