Various helper functions to perform mathematical and geometry operations in two dimensions
rotate, rotateAround, windingOrder, triangulatePolygons
splitCurve, convertGlyphToPolygons
dda, rasterizeTriangle, ddaOptions
boxLineIntersection, boxRayIntersection, pointInBox, pointInTriangle, pointInCurve, barycentricCoords
scale, multiply, divide, add, adds, sub, floor, abs, sign, dot, equal, length, normalize, avg, inRange
Install via npm install apl-easy-2d
, then import via ES6 Modules:
import { windingOrder } from 'apl-easy-2d';
Add the script tag below or download it an bundle it with your own scripts.
<script src="http://unpkg.com/apl-easy-2d/lib/apl-easy-2d.min.js"></script>
If you need to use a function that requires the 3rd-party library and have not included them separetely then include the umd which comes bundled with all dependencies.
<script src="http://unpkg.com/apl-easy-2d/lib/apl-easy-2d.umd.js"></script>
- Add unit tests to all functions
All code is licenced under MIT.