Skip to content

Mathematics

Mathematics here is split the way mathematical software conventionally splits it, not the way the packages are. Where a function lives on npm is an engineering detail; what it is for is what you came looking for.

What the machine’s own numbers can and cannot promise, and how to generate numbers on purpose.

  • Floating point and tolerance — why 0.1 + 0.2 !== 0.3, what an ulp is, and how to compare two results that should be equal but are not. (@ac-kit/math-scalar)
  • Random number generation — fast seedable generators for simulation, and the separate, slower ones you must use for anything a person could attack. (@ac-kit/math-random, @ac-kit/crypto-random)

When binary64 is the wrong container.

  • Integers and modular arithmetic (@ac-kit/math-integer)
  • Arbitrary precision, decimals and fractions (@ac-kit/math-numbers)
  • Complex numbers (@ac-kit/math-complex)
  • Algebraic structures — groups, rings and fields as values you pass to an algorithm (@ac-kit/math-algebra)

The named functions that statistics, physics and engineering are written in. Everything in this group takes numbers and returns a number.

Answering a question about a function you can only evaluate, one sample at a time. Everything in this group takes a function and calls it repeatedly.

  • Linear algebra — vectors, matrices and rotations (@ac-kit/math-linear)
  • Discrete grids — lattices, tiling and pixel conversion (@ac-kit/math-grid)
  • Geometry — shapes, coordinate systems and meshes (@ac-kit/math-geometry)
  • Curves — Bézier curves, splines and arc length (@ac-kit/math-curves)
  • Statistics — descriptive statistics, distributions and regression (@ac-kit/math-stats)
  • Combinatorics — factorials, binomial coefficients and generators (@ac-kit/math-combinatorics)
  • Signal processing — transforms, convolution, filters and windows (@ac-kit/math-signal)
  • Colour — colour spaces, gamut mapping and perceptual difference (@ac-kit/math-color)