o2edu / fermat.js

Mathematics, statistics and geometry library for JavaScript.

Home Page:http://mathigon.io/fermat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fermat.js

Fermat.js is a powerful mathematics, statistics and geometry library for JavaScript. 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.

npm npm

Features

  • Arithmetic: nearlyEquals(), toWord(), toFraction(), …
  • Combinatorics: factorial(), binomial(), permutations(), subsets()
  • Complex numbers: Complex()
  • Cryptography: caesarCipher(), vigenereCipher(), letterFrequency()
  • Expression parsing: Expression()
  • Geometry: Point(), Line(), Polygon(), Circle(), Angle(), as well as methods for geometric properties, projections, intersections and much more
  • 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(), …
  • Units: convert(), define()
  • Vector: Vector()

Usage

First, install fermat.js from NPM using

npm install @mathigon/fermat --save

Fermat.js uses ES6 imports. While some browsers and platforms now support this feature, we recommend using a transpiler such as Babel or Rollup. Make sure that you configure your compiler to correctly resolve these imports. For Rollup, we recommend using the rollup-plugin-node-resolve plugin.

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

About

Mathematics, statistics and geometry library for JavaScript.

http://mathigon.io/fermat

License:MIT License


Languages

Language:JavaScript 100.0%