@lakuna/umath
TypeScript icon, indicating that this package has built-in type declarations

1.3.8 • Public • Published

Test

μMath

A lightweight math library.

Documentation is automatically generated and uploaded to the website.

The source code can be found on the GitHub repository.

Linear Algebra API

In addition to exporting convenience classes representing a variety of linear algebra-related data types, each such type also has its own module that exports individual functions. For example, a two-by-two matrix can be imported in two different ways:

import { Matrix2 } from "@lakuna/umath";
import Matrix2 from "@lakuna/umath/Matrix2";

Using the convenience class, multiplying two two-by-two matrices would look like this:

import { Matrix2 } from "@lakuna/umath";

const a = Matrix2.fromValues(0, 1, 2, 3);
const b = Matrix2.fromValues(4, 5, 6, 7);
const c = a.multiply(b);

Using the raw functions, it could instead look like this:

import { multiply } from "@lakuna/umath/Matrix2";

const a = [0, 1, 2, 3];
const b = [4, 5, 6, 7];
const c = multiply(a, b, [0, 0, 0, 0]);

Dependents (1)

Package Sidebar

Install

npm i @lakuna/umath

Weekly Downloads

5

Version

1.3.8

License

MIT

Unpacked Size

1.11 MB

Total Files

168

Last publish

Collaborators

  • lakuna