calcufly-math
v1.0.0
Published
Math and statistics calculator functions - percentages, fractions, geometry, algebra, statistics, trigonometry. By CalcuFly.com
Maintainers
Readme
calcufly-math
Math and statistics calculator functions for Node.js. Percentages, fractions, geometry, algebra, statistics, trigonometry and more.
Part of the CalcuFly calculator suite — 600+ free online calculators.
Installation
npm install calcufly-mathQuick Start
const math = require('calcufly-math');
// Quadratic equation
const roots = math.quadratic(1, -5, 6);
console.log(roots); // { x1: 3, x2: 2 }
// Statistics
const data = [4, 8, 15, 16, 23, 42];
console.log(math.mean(data)); // 18
console.log(math.median(data)); // 15.5
console.log(math.standardDeviation(data));
// Geometry
console.log(math.circleArea(5)); // 78.54
console.log(math.sphereVolume(3)); // 113.10
console.log(math.pythagorean(3, 4)); // 5API Reference
| Function | Description |
|----------|-------------|
| percentage(value, percent) | Percentage of a value |
| percentageChange(old, new) | Percentage change |
| gcd(a, b) | Greatest common divisor |
| lcm(a, b) | Least common multiple |
| quadratic(a, b, c) | Solve quadratic equation |
| mean(numbers) | Average |
| median(numbers) | Median value |
| mode(numbers) | Most frequent values |
| standardDeviation(numbers) | Std deviation |
| correlation(x, y) | Pearson correlation |
| factorial(n) | Factorial |
| permutations(n, r) | Permutations |
| combinations(n, r) | Combinations |
| circleArea(r) | Circle area |
| triangleAreaHeron(a, b, c) | Triangle area (Heron) |
| sphereVolume(r) | Sphere volume |
| pythagorean(a, b) | Hypotenuse |
| isPrime(n) | Prime check |
| primeFactors(n) | Prime factorization |
| fibonacci(n) | Fibonacci sequence |
Try these calculations online at CalcuFly.com — free, no signup required.
License
MIT — CalcuFly
