Documentation / @interstellar-tools/maps / equirectangular
Function: equirectangular()
ts
function equirectangular(
phi: Radians,
lambda: Radians,
R: number,
options?: EquirectangularOptionsInterface
): ProjectedPointInterface;Defined in: projections/equirectangular.ts:91
Project a point on a sphere with the equirectangular projection: the simple cylindrical map, with latitude and longitude spaced evenly.
Where:
and are the point's latitude and longitude (rad) is the central meridian and the latitude of the origin (rad) is the standard parallel, where the scale is true (rad) is the sphere's radius (m)
Units
- Inputs: angles in radians,
Rin m. - Output:
{ x, y }in m.
Notes
- The usual format for global mosaics and elevation models, where it's called simple cylindrical: a grid in degrees is a grid on the map. With
it's the plate carrée, twice as wide as tall. - Distances are true along every meridian, and along the standard parallels
east–west. Elsewhere east–west distances are stretched by , so it keeps neither angles nor areas. - Choose
near the latitude of interest for a regional map: Mars mosaics of mid-latitude sites, for example. is wrapped to (−π, π]. −π itself stays on the left edge, so a line that ends there, like a ground track split at the antimeridian, isn't drawn across the map.
Parameters
| Parameter | Type | Description |
|---|---|---|
phi | Radians | Latitude |
lambda | Radians | Longitude |
R | number | Radius |
options? | EquirectangularOptionsInterface | lambda0, the central meridian, phi0, the latitude of the origin, and phi1, the standard parallel (radians, all default to 0). |
Returns
The point on the map, { x, y } in m.
Throws
- If any input is not a finite number.
- If
phiorphi0is outside [−π/2, π/2],phi1outside (−π/2, π/2), orR <= 0.
Example
ts
// 10° N, 20° E on a 3 389.5 km Mars, true to scale at 45°
equirectangular(toRad(10), toRad(20), 3_389_500, { phi1: toRad(45) });
// ≈ { x: 837 km, y: 592 km }See
- inverseEquirectangular
- mercator
- https://doi.org/10.3133/pp1395 Snyder (1987), Map projections: a working manual, ch. 12