mathigon / euclid.js

2D Euclidean geometry classes, utilities, and drawing tools
https://mathigon.io/euclid
MIT License
123 stars 12 forks source link
geometry mathematics svg

Euclid.ts

Build Status npm npm

Euclid.ts is a Typescript library for 2D geometry. It contains classes for elements like points, lines, circles, and polygons, intersection detection, as well as SVG and Canvas drawing tools. It was developed for Mathigon.org, an award-winning mathematics education project.

API

All class instances are immutable: you need to create new copies rather than modifying their properties. This is mainly to facilitate fast change detection on downstream libraries.

Usage

First, install Euclid.ts from NPM using

npm install @mathigon/euclid

Now, simply import all functions and classes you need, using

import {Point, Line} from '@mathigon/euclid'

Contributing

We welcome community contributions: please file any bugs you find or send us pull requests with improvements. You can find out more on Mathigon.io.

Before submitting a pull request, you will need to sign the Mathigon Individual Contributor License Agreement.

Copyright and License

Copyright © Mathigon (dev@mathigon.org)
Released under the MIT license