Documentation / @interstellar-tools/maps / inverseEquirectangular
Function: inverseEquirectangular()
ts
function inverseEquirectangular(
x: number,
y: number,
R: number,
options?: EquirectangularOptionsInterface
): GeographicCoordinatesInterface;Defined in: projections/equirectangular.ts:150
Find the point on a sphere for a point on an equirectangular map: the inverse of equirectangular.
Units
- Inputs:
x,yandRin m, the options in radians. - Output:
{ phi, lambda }in radians, within (−π, π].
Notes
- The map ends at the poles: a
ybeyond them throws aRangeError. is wrapped to (−π, π]: the map repeats east–west.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | Distance east of the origin in m (finite). |
y | number | Distance north of the origin in m (finite, on the map). |
R | number | Radius |
options? | EquirectangularOptionsInterface | lambda0, phi0 and phi1, as for equirectangular. |
Returns
GeographicCoordinatesInterface
The point on the sphere, { phi, lambda } in radians.
Throws
- If any input is not a finite number.
- If
yis beyond a pole,phi0is outside [−π/2, π/2],phi1outside (−π/2, π/2), orR <= 0.
Example
ts
inverseEquirectangular(836_620, 591_579, 3_389_500, { phi1: toRad(45) });
// ≈ { phi: 10° N, lambda: 20° E }, in radiansSee
- equirectangular
- https://doi.org/10.3133/pp1395 Snyder (1987), Map projections: a working manual, ch. 12