Skip to main content


Welcome to! is JavaScript (TypeScript) math library focused on geospatial and 3D use cases. Designed as a composable, modular toolbox. provides a core module with classic vector and matrix classes, and a suite of optional modules implementing various aspects of geospatial and 3D math.

While is highly optimized for use with the WebGL and WebGPU APIs, it has no WebGL dependencies and is designed to be usable in any application.


  • 3D math - Basic vectors and matrices, as well as 3D primitives and culling:,,
  • Geospatial projections - Support for a variety of geospatial projections,,,
  • Geospatial utilities - Cutting polygons and calculating sun position and direction,
  • Discrete Global Grids - Standardized interfaces to a number of the major discrete global grids.,,

Modules is a toolbox that offers a suite of composable modules.

Core math librariesModule Description math type helpers (NumericArray etc) math classes (vectors, matrices, etc) volumes and intersection testing.
Geospatial math librariesModule Description math for WGS84 coordinates. Gravity Model support . math, including geospatial cutting etc. between coordinate reference systems. position / direction from position and time. 3D Web Mercator (spherical) projections.
DGGS (Discrete global grid support) librariesModule Description geometry of GeoHash tokens. geometry of QuadKey tokens geometry of S2 tokens.

In addition, provides a few deprecated legacy modules, to avoid breaking older applications.

Legacy ModuleDescription
math.glRe-exports the API from An "alias" for to avoid breaking old applications.
viewport-mercator-projectRe-exports the Web Mercator projection utilities in The viewport-mercator-project repository was moved to in Oct 2019.

Supported Browsers and Node Versions is fully supported on:

  • Evergreen browsers: Recent versions of Chrome, Safari, Firefox, Edge etc.
  • Node.js: Active and Maintenance LTS releases


2015N/ classes were created as part of v4, as a set of class wrappers for gl-matrix for and frameworks. was broken out into its own repository to manage growth. The goal was to independently usable set of 3D and Geospatial math modules.
2018v2.0The API started to mature.
2019v3.0A collaboration with the Cesium team around 3D Tiles led to parts of the Cesium math library were ported into the and modules.
2020+v3.xAdditional geospatial modules have gradually been added to support more advanced use cases for
2022v3.6Code base fully rewritten in TypeScript.
2023v4.0ES module support. gl-matrix was removed as a dependency and became fully stand-alone.

Attributions was inspired by and built upon some of the most proven open source JavaScript math libraries:

  • gl-matrix - classes use gl-matrix under the hood
  • THREE.js math library - classes are API-compatible with a subset of the THREE.js classes and pass THREE.js test suites.
  • The CesiumJS math library (Apache2) - The geospatial and culling modules were ported from Cesium code base.


MIT license. The libraries that the core module are built on (e.g. gl-matrix) are also all open source and MIT licensed.

The and modules include Cesium-derived code which is Apache2 licensed. will never include any code that is not under permissive license.