Math Toolkit
## Overview The Math Toolkit API provides 48 endpoints covering statistics, linear algebra, number theory, geometry, financial math, and calculus. Full-precision computation. ## Key Features - **Statistics**: Mean, median, mode, std dev, variance, percentiles, correlation, regression, histograms - **Linear Algebra**: Matrix multiplication, determinant, inverse, transpose, eigenvalues - **Number…
Math Toolkit endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST |
Full descriptive statistics /statistics/describe |
Compute comprehensive descriptive statistics for a list of numbers. Returns: mean, median, mode, standard deviation (sample), variance (sample), min, max, range, percentiles… |
| POST |
Calculate a specific percentile /statistics/percentile |
Calculate the p-th percentile using linear interpolation. |
| POST |
Detect outliers using IQR method /statistics/outliers |
Detect outliers in a dataset using the IQR (Tukey) method. Values below Q1 - 1.5*IQR or above Q3 + 1.5*IQR are flagged as outliers. |
| POST |
Pearson correlation coefficient /statistics/correlation |
Calculate the Pearson correlation coefficient between two lists of numbers. Returns r (correlation), r_squared, and interpretation. |
| POST |
Simple linear regression /statistics/regression |
Perform simple linear regression (y = slope * x + intercept). Returns slope, intercept, r_squared, and predicted values. |
| GET |
Least Common Multiple of two or more integers /algebra/lcm |
Calculate the LCM of two or more integers. |
| GET |
Primality test /algebra/is-prime |
Check whether n is a prime number. |
| POST |
Bin numbers into a histogram /statistics/histogram |
Bin a list of numbers into a histogram with equal-width bins. Returns bin edges, counts, and relative frequencies. |
| GET |
Solve quadratic equation ax² + bx + c = 0 /algebra/quadratic |
Solve the quadratic equation ax² + bx + c = 0. Returns real roots when discriminant >= 0, complex roots otherwise. |
| GET |
Greatest Common Divisor of two or more integers /algebra/gcd |
Calculate the GCD of two or more integers. |
| GET |
Prime factorization /algebra/prime-factors |
Return the prime factorization of n as a sorted list (with repetition). |
| GET |
List of primes up to N (Sieve of Eratosthenes) /algebra/primes |
Return all prime numbers up to limit using the Sieve of Eratosthenes. |
| GET |
Fibonacci number(s) /algebra/fibonacci |
Compute Fibonacci number(s). - terms=false (default): returns F(n) where F(0)=0, F(1)=1 - terms=true: returns the list [F(0), F(1), ..., F(n)] |
| GET |
Factorial with arbitrary precision /algebra/factorial |
Compute n! using Python's arbitrary-precision integers. |
| GET |
The N-th prime number /algebra/nth-prime |
Return the n-th prime number (1-indexed). Supports up to the 100,000th prime. |
| GET |
Modular arithmetic operations /algebra/modular |
Modular arithmetic operations: - mod: a mod b - modpow: a^exp mod b - modinverse: modular inverse of a mod b (if it exists) |
| POST |
Evaluate a polynomial at x /algebra/polynomial |
Evaluate a polynomial at x given its coefficients in descending order. E.g. coefficients=[2, -3, 1] represents 2x² - 3x + 1. Uses Horner's method for numerical stability. |
| POST |
Calculate area of a shape /geometry/area |
Calculate the area of a shape. Supported shapes: circle, rectangle, triangle (base+height or Heron's), trapezoid, ellipse, regular_polygon, square. For triangle with 3 sides,… |
| POST |
Midpoint between two 2D points /geometry/midpoint |
Calculate the midpoint between two 2D points. |
| POST |
Calculate volume of a 3D shape /geometry/volume |
Calculate the volume of a 3D shape. Supported shapes: sphere, cylinder, cone, cube, rectangular_prism. |
| POST |
Distance between two points (2D or 3D) /geometry/distance |
Calculate the Euclidean distance between two points. Provide z1 and z2 for 3D distance. |
| POST |
Slope between two points /geometry/slope |
Calculate the slope and line equation between two 2D points. Returns slope, y-intercept, and the line equation y = mx + b. |
| POST |
Compound interest calculator /financial/compound-interest |
Calculate compound interest. Formula: A = P(1 + r/n)^(nt) where r is annual rate (decimal), n is compounding periods per year, t is years. |
| POST |
Simple interest calculator /financial/simple-interest |
Calculate simple interest. Formula: I = P * r * t, A = P + I |
| POST |
Loan amortization calculator /financial/loan-payment |
Calculate monthly loan payment, total interest, and optional amortization schedule. Uses the standard amortization formula: M = P[r(1+r)^n] / [(1+r)^n - 1] |
| POST |
Subtract two matrices /matrix/subtract |
Subtract matrix B from matrix A (A - B). Both must be the same dimensions. |
| POST |
Return on Investment /financial/roi |
Calculate ROI and optionally annualised ROI. ROI = (final_value - initial_investment) / initial_investment × 100 |
| POST |
Present value of a future cash flow /financial/present-value |
Calculate the present value (PV) of a future amount. PV = FV / (1 + r)^t |
| POST |
Future value of a present amount /financial/future-value |
Calculate the future value (FV) of a present amount. FV = PV * (1 + r)^t |
| POST |
Break-even analysis /financial/break-even |
Calculate break-even units and revenue. Break-even units = Fixed Costs / (Price - Variable Cost per Unit) |
| POST |
Internal Rate of Return (approximation) /financial/irr |
Estimate the Internal Rate of Return (IRR) for a series of cash flows. The first cash flow is typically the initial investment (negative). Uses Newton-Raphson iteration. |
| POST |
Profit margin and markup calculator /financial/margin-markup |
Calculate both profit margin and markup. - Margin = (Revenue - Cost) / Revenue × 100 - Markup = (Revenue - Cost) / Cost × 100 |
| GET |
Health check /health |
|
| GET |
Convert a number between any bases (2–36) /convert/base |
Convert a number from one base to another (both in range 2–36). Supports negative numbers (prefix with '-'). |
| GET |
Convert between Roman numerals and decimal /convert/roman |
Convert between Roman numerals and decimal integers. - Provide a number (e.g. '42') to get its Roman numeral. - Provide a Roman numeral (e.g. 'XLII') to get its decimal value. -… |
| GET |
Convert to/from scientific notation /convert/scientific |
Convert a number to or from scientific notation. - to='scientific': e.g. '602200000000000000000000' → '6.022e+23' - to='decimal': e.g. '6.022e23' → 602200000000000000000000.0 |
| GET |
Approximate a decimal as a fraction /convert/fraction |
Approximate a decimal as a fraction with a bounded denominator. Uses Python's Fraction class with the best rational approximation. |
| GET |
Generate an identity matrix /matrix/identity |
Generate an NxN identity matrix. |
| GET |
Temperature unit conversion /convert/temperature |
Convert temperature between Celsius, Fahrenheit, and Kelvin. |
| POST |
Add two matrices /matrix/add |
Add two matrices of identical dimensions. |
| POST |
Multiply two matrices /matrix/multiply |
Multiply matrix A by matrix B (A × B). A must be MxK and B must be KxN; result is MxN. |
| POST |
Dot product of two vectors (1D matrices) /matrix/dot-product |
Calculate the dot product of two vectors. Both inputs should be single-row or single-column matrices of the same length. |
| POST |
Transpose a matrix /matrix/transpose |
Transpose a matrix (flip rows and columns). |
| POST |
Calculate matrix determinant (up to 4x4) /matrix/determinant |
Calculate the determinant of a square matrix. Supported for matrices up to 4x4. |
| POST |
Calculate matrix inverse (up to 3x3) /matrix/inverse |
Calculate the inverse of a square matrix. Supported for 2x2 and 3x3 matrices. |
| POST |
Multiply a matrix by a scalar /matrix/scalar-multiply |
Multiply every element of a matrix by a scalar value. |
| POST |
Calculate the trace of a square matrix /matrix/trace |
Calculate the trace of a square matrix (sum of main diagonal elements). |
| GET |
Root endpoint / |
Math Toolkit pricing
| Plan | Price | Rate limit | Quotas |
|---|---|---|---|
| BASIC | Free | — |
|
| Pro | $9.99 / month | 20 / minute |
|
| Ultra | $29.99 / month | 100 / minute |
|