Introduction
Welcome to math.gl!
math.gl is a modular TypeScript toolbox for geospatial and 3D math. Start with vectors and matrices in core, then add modules for coordinate conversion, geometry, global grids, and other application needs.
math.gl computes on the CPU and has no GPU dependencies. Its arrays and coordinate utilities can supply WebGL, WebGPU, or other rendering systems.
math.gl is part of Open Visualization, an OpenJS Foundation / Linux Foundation project.
Modules
Modular geospatial & 3D math
Small tools. Big spatial ideas.
Pick the building blocks you need—from vectors and meshes to coordinate systems, global grids, and time-aware geospatial analysis.
Foundations
Vectors, matrices, task execution, shared numeric types and expression evaluation.
Core
Vectors, matrices, shared types, and expression evaluation.
Explore moduleTasks
Run small tasks locally and larger jobs in worker pools, with bounded queues and shared state.
Explore moduleTypes
Small, reusable TypeScript contracts for math and geospatial data.
Explore moduleExpressions
ExperimentalParse and evaluate compact expressions with optional geospatial functions.
Explore module3D
Curves, meshes, geometry processing and visibility.
Curves
Parametric curves, interpolation, and arc-length sampling in 2D and 3D.
Explore moduleGeometry
Meshes, curves, polygon processing, culling, and spatial indexes.
Explore moduleGeometry Utils
Inspect, normalize, and process geometry stored in typed arrays.
Explore moduleCulling
Bounding volumes, intersection tests, and visibility culling.
Explore modulePolygon
Clip, subdivide, triangulate, and transform polygon and line geometry.
Explore moduleSpatial index
Static box, point and triangle indexes for range, ray and nearest queries (POC).
Explore moduleGeospatial
Coordinate systems, projections, and geospatial data formats.
Geospatial
Ellipsoids, CRS, projections, WKB, and GeoArrow entry points.
Explore moduleCRS
Lightweight coordinate reference system definitions and syntax codecs.
Explore moduleProjection
Project coordinates, transform reference systems, and work across epochs.
Explore moduleWeb Mercator
Map projection and camera utilities for interactive web maps.
Explore moduleGeoArrow
Columnar geospatial layouts and kernels over typed-array buffers.
Explore moduleWKB
Dependency-free WKB, EWKB, and WKT geometry codecs.
Explore moduleEarth
Coordinate reference systems, Earth models, maps and time.
Earth
Grouped paths for geoid, sun, and timezone utilities.
Explore moduleGeoid
Sample Earth gravity models and convert ellipsoidal and geoid heights.
Explore moduleTimezone
Geographic timezone lookup and local calendar calculations.
Explore moduleSun
Calculate sun position, daylight, and atmospheric lighting.
Explore moduleDGGS
A separate module for discrete global grid systems.
Package entry points
The grouped package entry points are:
| Package | Subpaths |
|---|---|
@math.gl/core | /types, /expressions |
@math.gl/geometry | /utils, /curves, /polygon, /culling, /spatial-index |
@math.gl/geospatial | /ellipsoid, /globe, /tiles, /crs, /projection, /web-mercator, /wkb, /geoarrow, /expressions |
@math.gl/earth | /geoid, /sun, /timezone |
The implementations live in these grouped packages. The former standalone leaf packages have
been removed. @math.gl/dggs remains separate; @math.gl/web-mercator is retained for compatibility.
Legacy packages
The unscoped math.gl compatibility package has been removed from the workspace; use
@math.gl/core for core math. @math.gl/web-mercator remains available for compatibility, and
viewport-mercator-project re-exports Web Mercator utilities.
Supported Browsers and Node Versions
math.gl is fully supported on:
- Evergreen browsers: Recent versions of Chrome, Safari, Firefox, Edge etc.
- Node.js: Active and Maintenance LTS releases
History
| Year | Version | Description |
|---|---|---|
| 2026 | v5.0 (prerelease) | A new projection engine, global grid adapters, WKB and GeoArrow geometry processing, and Earth utilities, organized into focused package entry points. See what’s new. |
| 2023 | v4.0 | ES module support. gl-matrix was removed as a runtime dependency; adapted numerical kernels remain in core. |
| 2022 | v3.6 | Code base fully rewritten in TypeScript. |
| 2020+ | v3.x | Additional geospatial modules have gradually been added to support more advanced use cases for deck.gl. |
| 2019 | v3.0 | A collaboration with the Cesium team around 3D Tiles led to ports of parts of the Cesium math library into the math.gl/geospatial and @math.gl/geometry/culling modules. |
| 2018 | v2.0 | The math.gl API started to mature. |
| 2017 | v1.0 | math.gl was broken out into its own repository to manage luma.gl growth. The goal was an independently usable set of 3D and Geospatial math modules. |
| 2015 | N/A | @math.gl/core classes were created as part of luma.gl v4, as a set of class wrappers for gl-matrix for luma.gl and deck.gl frameworks. |
References and credits
See References and credits for contributor acknowledgments, upstream libraries, scientific references, dataset credits, and third-party notices.
License
MIT license. Derived kernels retain their upstream notices.
Selected modules include Apache-2.0 or ISC licensed upstream code. Optional datasets can have separate licenses; see each module's attribution and distributed notices.
Package code uses permissive licenses. Dataset licenses and attribution are documented separately.