@figureland/mathkit
TypeScript icon, indicating that this package has built-in type declarations

0.0.35 • Public • Published

mathkit illustration

CI NPM

mathkit is a collection of tools for working with numbers, matrices, shapes and more. The aim here is to have something minimal and unbloated, and also a place to learn by building from scratch.

[!NOTE] It would be great to use DOMMatrix and DOMPoint more. I could remove a big chunk of this library. But somehow I found them inflexible and didn't perform that well. Maybe something to do with having to call new DOMMatrix() every time you want to multiply two matrices, for example, feels as if it incurs a real cost if you're running it every frame. Maybe in 2024 that's not the case and when I have time I will revisit. They would need to be polyfilled somehow in Bun/node.js servers.

In the meantime, there are some helpers in src/style.ts to help with translation.

Credit to gl-matrix for inspiration, some API choices and indeed directly copying over a few methods. A library I've used many many times over the years.

Scripts

Install

bun install

Test

bun test

Build

bun run build

Readme

Keywords

none

Package Sidebar

Install

npm i @figureland/mathkit

Weekly Downloads

309

Version

0.0.35

License

MIT

Unpacked Size

53.9 kB

Total Files

23

Last publish

Collaborators

  • trmg.figure
  • tobymg