@thyseus/math
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@thyseus/math

A math package for use with Thyseus - or for general use if you need your math primitives as classes.

This package is essentially a class reimplementation of gl-matrix; all credit to toji and gl-matrix maintainers.

Installation

pnpm add @thyseus/math

Principles

  • this is mutable; arguments are immutable.
    • Methods never mutate passed arguments, only this!
  • No hidden object creation.
    • Methods other than clone() never create objects.
  • Fully tree-shakeable.
    • While some methods assume certain types as arguments, there are no internal dependencies so you only pay for what you use.

API

Classes

  • Mat4
  • Quat
  • Vec2
  • Vec3
  • Vec4

Functions

  • clamp(min: number, value: number, max: number): number
  • degreesToRadians(degrees: number): number
  • radiansToDegrees(radians: number): number

Constants

  • HALF_PI
  • PI
  • TAU
  • ORIGIN
  • EPSILON
  • NORTH / SOUTH / EAST / WEST / UP / DOWN

Package Sidebar

Install

npm i @thyseus/math

Weekly Downloads

6

Version

0.1.0

License

MIT

Unpacked Size

72.2 kB

Total Files

6

Last publish

Collaborators

  • jaime-gensler