1.0.5 • Published 3 years ago
@syaleni/linebra v1.0.5
Linebra
A small library for linear algebra oprations.
Usage
// ESM:
import * as linebra from 'linebra';
// CJS:
const linebra = require('linebra');
Defintions
Vertex
const v = { x: 1, y: 1 };
Segment
const s = [
{ x: 1, y: 1 },
{ x: 3, y: 3 },
];
Line
const l = { m: 1, c: 3 }; // i.e. y = m * x + c
Polygon
An ordered set of vertices:
const p = [
{ x: 1, y: 1 },
{ x: 3, y: 3 },
{ x: 0, y: 3 },
];