HarryStevens/geometric

A JavaScript library for doing geometry.

JavaScript

1,105

391 commits

updated Jun 19, 2026

See the code

README

Geometric.js

Geometric.js logo

CI npm version npm downloads license

Geometric.js is a JavaScript library for working with points, lines, polygons, and angles. It uses plain JavaScript arrays for geometry primitives, includes TypeScript declarations for editor autocomplete and type checking, and works in modern browsers and Node.js.

Documentation and interactive examples are on the Geometric.js website.

Install

npm install geometric -S
import * as geometric from "geometric";

Why Geometric.js?

Geometric.js keeps geometry simple. A point is an [x, y] array, a line is an array of two points, and a polygon is an array of points.

import { pointTranslate, lineRotate, polygonScale } from "geometric";

const point = [0, 0];
const line = [
  [0, 0],
  [10, 10],
];
const polygon = [
  [0, 0],
  [10, 0],
  [10, 10],
  [0, 10],
];

const translated = pointTranslate(point, 90, 10);
const rotated = lineRotate(line, 90);
const scaled = polygonScale(polygon, 2);

There are no custom classes to instantiate and no special data structures to learn. The values you pass into Geometric.js are the same values you can serialize, inspect, and draw to SVG or Canvas.

Development

pnpm install
pnpm test

The test suite builds the package, runs runtime tests, and checks the TypeScript declarations.

geometry

HarryStevens/geometric

A JavaScript library for doing geometry.

JavaScript

1,105

391 commits

updated Jun 19, 2026

See the code

README

Geometric.js

Geometric.js logo

CI npm version npm downloads license

Geometric.js is a JavaScript library for working with points, lines, polygons, and angles. It uses plain JavaScript arrays for geometry primitives, includes TypeScript declarations for editor autocomplete and type checking, and works in modern browsers and Node.js.

Documentation and interactive examples are on the Geometric.js website.

Install

npm install geometric -S
import * as geometric from "geometric";

Why Geometric.js?

Geometric.js keeps geometry simple. A point is an [x, y] array, a line is an array of two points, and a polygon is an array of points.

import { pointTranslate, lineRotate, polygonScale } from "geometric";

const point = [0, 0];
const line = [
  [0, 0],
  [10, 10],
];
const polygon = [
  [0, 0],
  [10, 0],
  [10, 10],
  [0, 10],
];

const translated = pointTranslate(point, 90, 10);
const rotated = lineRotate(line, 90);
const scaled = polygonScale(polygon, 2);

There are no custom classes to instantiate and no special data structures to learn. The values you pass into Geometric.js are the same values you can serialize, inspect, and draw to SVG or Canvas.

Development

pnpm install
pnpm test

The test suite builds the package, runs runtime tests, and checks the TypeScript declarations.

geometry

Project health

Overall

2.8/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Latest release

3.0.9 · Jun 19, 2026

Releases this year

10

Significant stargazers

Eduardo San Martin Morote

6,585 followers · starred Jun 2026

Neko

1,698 followers · starred Jun 2026

Kyle Simpson

45,440 followers · starred Jun 2026

Ian Storm Taylor

3,028 followers · starred May 2022