Documentation / @interstellar-tools/tracking / globeView
Function: globeView()
ts
function globeView(
points: readonly Pick<GeodeticCoordinatesInterface, 'phi' | 'lambda'>[],
R?: number,
options?: GlobeViewOptionsInterface
): GlobePointInterface[];Defined in: satellites/globe.ts:191
Points on a globe view: the orthographic projection, a globe seen from far away, with the points on the far side marked hidden. It draws ground tracks and footprints on a 2D globe, without WebGL.
A point is visible when
Where:
, are the point's latitude and longitude (rad) , are those of the centre of the view (rad) is the globe's radius on the screen, in any unit
Units
- Inputs: latitudes and longitudes in radians;
Rin the unit of the drawing. - Output:
xandyin the unit ofR, from the centre of the disc, withvisible.
Notes
- Every point gets
xandy, the far side's mirrored onto the disc, so a renderer can fade them or break a line where it goes behind.orthographicin@interstellar-tools/mapsthrows for them instead. - For points on the ground: a satellite above the far side can still show past the edge of the disc. Project its 3D position from orbitPath3D for that.
- Any
hon the points is ignored.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
points | readonly Pick<GeodeticCoordinatesInterface, "phi" | "lambda">[] | undefined |
R? | number | 1 | The globe's radius, in the unit of the drawing (finite, > 0): 1 by default. |
options? | GlobeViewOptionsInterface | {} | The centre of the view, phi0 and lambda0 in radians: 0 and 0 by default. |
Returns
The points on the disc, in order: see GlobePointInterface.
Throws
- If a latitude, longitude,
R,phi0orlambda0is not a finite number. - If a latitude or
phi0is outside [-π/2, π/2], orR <= 0.
Example
ts
// The ISS's next orbit, on a globe of radius 200 px centred on Oslo
const track = groundTrack(iss, now, later).flat();
const view = globeView(track, 200, {
phi0: toRad(59.91),
lambda0: toRad(10.75)
});
view.filter(({ visible }) => visible); // the part of the track on the near side