Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Frontend GIS
  3. Geometric.js

Geometric.js

MITJavaScriptv2.2.5

A JavaScript library for performing 2D geometric calculations on points, lines, and polygons.

Visit WebsiteGitHubGitHub
1.0k stars51 forks0 contributors

What is Geometric.js?

Geometric.js is a JavaScript library for performing 2D geometric calculations on points, lines, and polygons. It provides functions for transformations, measurements, and relationship detection, solving the need for manual geometry math in visualization, gaming, or computational applications. The library uses simple array representations for primitives, making it easy to integrate into existing JavaScript projects.

Target Audience

JavaScript developers working on data visualization, computer graphics, game development, or computational geometry projects that require precise 2D geometric operations.

Value Proposition

Developers choose Geometric.js for its focused, dependency-free approach to 2D geometry, offering a comprehensive set of well-documented functions without the overhead of larger math or graphics libraries. Its simple API and clear examples make it accessible for both learning and production use.

Overview

A JavaScript library for doing geometry.

Use Cases

Best For

  • Calculating polygon areas and centroids in data visualizations
  • Detecting collisions and intersections in 2D games
  • Generating and manipulating geometric shapes for graphics applications
  • Performing point-in-polygon tests for geographic or UI hit detection
  • Creating convex hulls from point sets for computational geometry
  • Transforming and interpolating geometric primitives in animations

Not Ideal For

  • Applications requiring 3D geometric calculations, such as 3D modeling or WebGL visualizations
  • High-performance real-time simulations or games needing optimized, low-level geometry libraries
  • Projects needing advanced geometric primitives like curves, circles, or splines beyond basic polygons
  • Systems deeply integrated with frameworks like Three.js or D3 that have built-in geometry utilities

Pros & Cons

Pros

Clean, Intuitive API

Represents geometric primitives as simple arrays (e.g., [x,y] for points), making it easy to learn and integrate, as emphasized in the README's API structure.

Comprehensive 2D Toolkit

Offers a wide range of functions for transformations (rotate, scale), measurements (area, length), and relationships (intersections, containment), covering most common 2D geometry tasks.

No External Dependencies

The library is self-contained and lightweight, with no dependencies, aligning with its philosophy of simplicity and practicality for easy deployment.

Well-Documented with Examples

Each function includes source links and Observable notebook examples, providing clear, practical guidance that reduces implementation time.

Cons

Strictly 2D Focus

Lacks support for 3D geometry operations, limiting its utility in applications requiring spatial calculations beyond the plane, as admitted by its narrow scope.

Basic Data Representation

Relies on plain arrays without object-oriented or optimized data structures, which can lead to performance issues or cumbersome code for complex manipulations.

Missing Advanced Features

Does not include operations for curves, circles, or other non-polygonal shapes, focusing only on points, lines, and polygons, which restricts more sophisticated geometric work.

Frequently Asked Questions

Quick Stats

Stars1,020
Forks51
Contributors0
Open Issues9
Last commit1 month ago
CreatedSince 2018

Tags

#geometry#math#javascript-library#transformations#2d-graphics#computational-geometry

Built With

J
JavaScript

Links & Resources

Website

Included in

Frontend GIS675
Auto-fetched 6 hours ago

Related Projects

Turf.jsTurf.js

A modular geospatial engine written in JavaScript and TypeScript

Stars10,358
Forks1,001
Last commit15 hours ago
topoJSONtopoJSON

An extension of GeoJSON that encodes topology! 🌐

Stars4,879
Forks683
Last commit1 year ago
geolibgeolib

Zero dependency library to provide some basic geo functions

Stars4,276
Forks338
Last commit1 month ago
rbushrbush

RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles

Stars2,738
Forks254
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub