# maths

0.1.0 • Public • Published

# maths

Panoply of Math Functions for NodeJS.

To build this, `npm install -g voc` and `voc README.md`

# Code

## Gamma Function

substack's gamma library provides the regular gamma function:

The `gamma` function takes a single real parameter.

Both matlab and Excel use the function name `gammaln` to refer to the natural log of the gamma function. Mathematica uses the name `LogGamma` and scipy uses the name `loggamma`. Both names will be used:

``````exports.gammaln = gamma.log;
exports.loggamma = gamma.log;
``````

## Gamma's Friends

The regular beta function is a straightforward manipulation of gamma:

The lesser-known Pochhammer symbol is even simpler (uses Mathematica order):

``````var pochhammer = function(a,n) { return gamma(a+n) / gamma(a); };
var pochhammerln = function(a,n) { return gamma.log(a+n) - gamma.log(a); };
pochhammer.log = pochhammerln;
exports.pochhammer = pochhammer;
exports.pochhammerln = pochhammerln;
``````

## Bessel Functions

SheetJS's bessel library provides the Bessel functions:

The bessel functions accept the parameters `(x, n)` where `n` is the order of the solution and `x` is the point at which to evaluate:

## Fractions

SheetJS's frac library provides the frac function for rational approximations to numbers:

The frac function accept the parameters `(x, D, m)` where `x` is the number you wish to approximate, `D` is an upper bound on the denominator, and `m` is a flag indicating that you want mixed rather than improper fractions:

none

## Package Sidebar

### Repository

github.com/SheetJS/maths

31

0.1.0