Easy 2D
Various helper functions to perform mathematical and geometry operations in two dimensions
Included functions
---
$3
rotate, rotateAround, windingOrder, triangulatePolygons
---
$3
splitCurve, convertGlyphToPolygons
---
$3
dda, rasterizeTriangle, ddaOptions
---
$3
boxLineIntersection, boxRayIntersection, pointInBox, pointInTriangle, pointInCurve, barycentricCoords
---
$3
scale, multiply, divide, add, adds, sub, floor, abs, sign, dot, equal, length, normalize, avg, inRange
Using in node
Install via
npm install apl-easy-2d, then import via ES6 Modules:
``
typescript
import { windingOrder } from 'apl-easy-2d';
`
Using in the browser
Add the script tag below or download it an bundle it with your own scripts.
`
html
``
TODO
- Add unit tests to all functions
Licence
All code is licenced under MIT.