maths.ts
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

Build Status Version Downloads Maintenance License

maths.ts

A very extensive library for doing maths!

Maths.ts is a very extensive library for doing maths in TypeScript, JavaScript and Node.js. It is written in TypeScript looking for a strong typing. Math.ts features an expression parser and many other math functions to work comfortably with any data type coming.

Moreover, maths.ts is not limited to just some math functions. Maths.ts includes support for some well known algorithms such as graph's handling algorithms, some linear algebra approximation methods and algorithms, among others.

Features

  • Support for real numbers and high accuracy operations between them.
  • Support for matrices and vectors and operations between them as well as their properties (determinant, transpose, etc.).
  • Support for arithmetic properties of some numbers (greatest common divisor, least common multiple, factors of a number).
  • Embedded algorithms implemented.
    • Merge sort.
    • Quick sort.
    • Sieve of Eratosthenes.
    • Graph search algorithms (BFS, DFS, a-star, greedy search, etc.).
  • Embedded data structures.
    • Bit set.
    • Matrix.
    • Graph.
  • Open source.

Upcoming features

  • Support for algebraic expression and operations with them (derive, integrate, calculating the value of a variable, etc.).
  • Support for combinatorics, geometry and topology, probability and statistics, and many other computer science and mathematics related.
  • Symbolical computing.
  • Embedded plotter for functions.
  • Embedded algorithms.
    • Simplex algorithm.
    • MODI algorithm for transportation theory problems.

Installing

Maths.ts is available as the maths.ts package on npm.

npm install maths.ts

Usage

We are working on a website to upload several examples but at this time we only have a few. Here is the first one to get you started:

let math = require('maths.ts');
    
= math.evaluate('2*3'); // maths.ts obj {6}
a.multiply(4); // maths.ts obj {24}

Please use brackets to avoid ambiguities like 2^3^4. 2^3^4 may be interpreted as 2^(3^4) as well as (2^3)^4, throwing two different results.

Browser support

At this time it is not available on a CDN. So in order to use it in browser it is necessary to compile it. To do so you'll need to follow the next instructions:

git clone https://github.com/IpiVasquez/maths.ts.git
cd maths.ts
npm install
npm run gulp

These lines will create a file on maths.ts/bundle/ which will contain maths.js and maths.min.js, ready to use in your browser.

Documentation

Contributing

There are many ways to contribute to maths.ts.

  • Submit bugs and help us verify fixes as they are checked in.
  • Review source code changes.
  • Suggest/implement new features.
  • Recommend this library.
  • Contribute bugs fixes.

This project has adopted the Contributor Covenant Code of Conduct.

Package Sidebar

Install

npm i maths.ts

Weekly Downloads

55

Version

0.0.8

License

MIT

Last publish

Collaborators

  • ipi.vasquez