Reference · The globe as an SVG string
routePointsfunction
Points along the geodesic from from to to, including both ends. count is how many (2 when they are the same place, 64 when left out).
When the geodesic does not converge, the points are the great circle (trackSteps).
Import it
import { routePoints } from "@johnmorrisdotca/chikyu-earth";
Definition
function routePoints(from: GeoPoint, to: GeoPoint, count?: number): GeoPoint[]
Parameters
| Name | Type | Description |
|---|---|---|
from | GeoPoint | The start. |
to | GeoPoint | The end. |
count (optional) | number | How many points, at least 2. |
Returns
GeoPoint[]
The points, or an empty list when a place is not on the Earth.
Examples
import { routePoints } from "@johnmorrisdotca/chikyu-earth";
console.log(routePoints({ lon: 0, lat: 0 }, { lon: 1, lat: 0 }, 3).length);3What it prints (run when this page was built)