3.0.3 • Published 4 months ago

enhancedmath v3.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
4 months ago

Enhanced Math

This package contains some enhanced mathematical operations:

Usage

Start by importing the main object into your document

import EM from 'enhancedmath';

Every single method is added onto this object, treat it a bit like the built-in Math object. Some methods are divided into further object, so search through the object for what you need.

Examples
Factorial
import EM from 'enhancedmath';

const f = EM.factorial(10);
console.log(f);
Algebra - Discriminator
import EM from 'enhancedmath';

const d = EM.algebra.discriminator(2, 9, -1);
if (d < 0) {
  console.log('...');
} else if (d === 0) {
  console.log('...');
} else {
  console.log('...');
}
Algebra - Bisection

Depending on the range of the starting interval, you will find different intersection points

import EM from 'enhancedmath';

let result = EM.algebra.intersectionPoints.bisection(-2, 0, 0.001, (x: number) => x * x - 1);
console.log(result);
result = EM.algebra.intersectionPoints.bisection(0, 2, 0.001, (x: number) => x * x - 1);
console.log(result);
Matrix - Transpose
import EM from 'enhancedmath';

const m = [
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9]
];
const trans_m = EM.matrix.transpose(m);
console.log(trans_m);
Matrix - Swap Row
import EM from 'enhancedmath';

const matrix = [
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9]
];

const swappedMatrix = EM.matrix.mutations.swapRow(matrix, 0, 2);
console.log(swappedMatrix);
Probability - Stem and leaf plot
import EM from 'enhancedmath';

const data = [8, 12, 23, 9, 102, 7, 87, 68, 83, 25, 19, 28];
const plot = EM.probability.stemleafplot(data);
console.log(plot);

Developer

Mout Pessemier:

Buy me a coffee

If you like this package, consider buying me a coffee. It will help me to keep this package up to date and create new packages.

ko-fi

Contributors

3.0.3

4 months ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.15.0

1 year ago

2.15.1

1 year ago

2.13.2

1 year ago

2.14.0

1 year ago

2.13.0

1 year ago

2.13.1

1 year ago

2.12.0

1 year ago

2.11.0

4 years ago

2.11.1

4 years ago

2.10.0

4 years ago

2.9.2

4 years ago

2.9.3

4 years ago

2.9.1

4 years ago

2.9.0

4 years ago

2.7.0

5 years ago

2.8.0

5 years ago

2.6.2

5 years ago

2.6.1

5 years ago

2.6.0

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.2.2

5 years ago

1.2.0

5 years ago

1.2.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago