Fermat.js
Mathematics and statistics library for TypeScript.
Install / Use
/learn @mathigon/Fermat.jsREADME
Fermat.ts
Fermat.ts is a powerful mathematics and statistics library for TypeScript. It contains everything from number theory to random numbers, expression parsing and linear algebra classes. It was developed for Mathigon.org, an award-winning mathematics education project.
Features
Note: in version 0.6.0, all geometry classes and functions were moved to
@mathigon/euclid!
- Arithmetic:
nearlyEquals(),toWord(),toFraction(), … - Combinatorics:
factorial(),binomial(),permutations(),subsets() - Complex numbers:
Complex() - Cryptography:
caesarCipher(),vigenereCipher(),letterFrequency() - Matrices:
Matrix.product(),Matrix.determinant(),Matrix.inverse(), … - Number theory:
gcd(),isPrime(),generatePrime(),goldbach(), … - Numeric:
bisect(),integrate() - Random:
Random.shuffle(),Random.binomial(),Random.normalPDF(), … - Regression:
Regression.linear(),Regression.coefficient(), … - Statistics:
mean(),variance(),linearRegression(), … - Vector:
Vector()
Usage
First, install Fermat.ts from NPM using
npm install @mathigon/fermat
Now, simply import all functions and classes you need, using
import {Complex, gcd} from '@mathigon/fermat'
Contributing
We welcome community contributions: please file any bugs you find or send us pull requests with improvements. You can find out more on Mathigon.io.
Before submitting a pull request, you will need to sign the Mathigon Individual Contributor License Agreement.
Copyright and License
Copyright © Mathigon (dev@mathigon.org)
Released under the MIT license
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
84.2kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
review-duplication
99.5kUse this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
