Skip to content

Documentation / @interstellar-tools/maps / inverseMollweide

Function: inverseMollweide() ​

ts
function inverseMollweide(
  x: number,
  y: number,
  R: number,
  options?: ProjectionOptionsInterface
): GeographicCoordinatesInterface;

Defined in: projections/mollweide.ts:169

Find the point on a sphere for a point on a Mollweide map: the inverse of mollweide.

θ=arcsin⁡y2R,φ=arcsin⁡2θ+sin⁡2θπ,λ=λ0+πx22Rcos⁡θ

Units

  • Inputs: x, y and R in m, lambda0 in radians.
  • Output: { phi, lambda } in radians, with λ in (−π, π].

Notes

  • No iteration is needed this way round. Within about 10−7 rad of a pole, arcsin of a number so close to 1 limits φ to about 10−9 rad.
  • Only points inside the ellipse have an inverse: a point outside it throws a RangeError.
  • Every longitude meets at a pole, so there λ is λ0.

Parameters ​

ParameterTypeDescription
xnumberDistance east of the origin in m (finite, on the map).
ynumberDistance north of the origin in m (finite, on the map).
RnumberRadius R of the sphere in m (finite, > 0).
options?ProjectionOptionsInterfacelambda0, the central meridian (radians, defaults to 0).

Returns ​

GeographicCoordinatesInterface

The point on the sphere, { phi, lambda } in radians.

Throws ​

  • If any input is not a finite number.
  • If the point is outside the map's ellipse, or R <= 0.

Example ​

ts
inverseMollweide(2 * Math.SQRT2, 0, 1); // { phi: 0, lambda: π }

See ​