-
Notifications
You must be signed in to change notification settings - Fork 4
Home
mathlib-n is a Node.js library that provides a comprehensive set of mathematical functions and algorithms. It is built on top of the popular math.js library, and it extends math.js with a number of new features, including:
- Support for matrices, vector and tensors
- Support for symbolic algebra
- Support for statistical functions and probability distributions
mathlib-n is easy to use and install. To get started, simply install the library using npm:
npm install mathlib-n
Once you have installed the library, you can start using it in your Node.js code by importing the library:
const math = require('mathlib-n');
Full doc: https://github.com/MarufHasan24/mathlib_wiki
Here are some examples:
Once you have imported the library, you can access all of its contents, such as functions, constants, and variables. For example, to calculate the square root of a number, you would simply write:
const result = math.sqrt(2);
The result of the calculation will be stored in the variable result
.
mathlib-n is a powerful and versatile library that can be used for a wide variety of mathematical tasks. It is ideal for students, researchers, and developers who need to perform complex mathematical operations in their Node.js code.
Here are some examples of how to use mathlib-n:
// Calculate the factorial of a number
const result = math.factorial(10);
// Calculate the determinant of a matrix
const matrix = new math.Matrix([[1, 2], [3, 4]]);
const result = matrix.det();
mathlib-n also provides a number of symbolic algebra functions. For example, to solve the equation x2 + 2x + 1 = 0, you would simply write:
const result = math.linerEq(1,2,1);
The result of the calculation will be an array containing the two solutions to the equation.
mathlib-n is a powerful and versatile library that can be used for a wide variety of mathematical tasks. It is ideal for students, researchers, and developers who need to perform complex mathematical operations in their Node.js code.