1 | # Ella
|
2 |
|
3 | Geometry and linear algebra library that provides basic vector and matrix calculus operations.
|
4 |
|
5 | ## Features
|
6 |
|
7 | Features:
|
8 |
|
9 | - vector addition, subtraction, scalar multiplication, dot product, cross product
|
10 | - calculate vector length
|
11 | - normalize vector
|
12 | - matrix multiplication, determinant,
|
13 | - translation and projection matrices
|
14 | - matrix vector multiplication
|
15 | - basic geometry shapes
|
16 |
|
17 | ## Install and usage
|
18 |
|
19 | You can either import ella via NPM or directly use it via script tag.
|
20 |
|
21 | ### NPM:
|
22 |
|
23 | First, run: `npm i ella-math`
|
24 |
|
25 | ```js
|
26 | import { Vec, Mat } from 'ella-math';
|
27 |
|
28 | const a = new Vec(1, 2, 3);
|
29 | const b = new Vec(2, 3, 4);
|
30 |
|
31 | console.log(a.add(b));
|
32 | ```
|
33 |
|
34 | ### Directly in the browser
|
35 |
|
36 | Add this script tag: `<script src="https://unpkg.com/ella-math@latest/dist/ella.umd.js"></script>`
|
37 |
|
38 | ```js
|
39 | const { Vec, Mat } = Ella;
|
40 | ```
|