Nine Pedestrians Mesmerized

# npm

Have ideas to improve npm?Join in the discussion! »

## math-interpolate

5.0.0 • Public • Published

# math-interpolate

## Install

``````\$ yarn add math-interpolate
``````

## Interpolation cases usage

So, you can use methods below

• linear by `({ x, x1, y1, x2, y2 })`
• bilinear by `({ x, y, x1, y1, x2, y2, q11, q12, q21, q22 })`
• byInternalTable by `({ x, y, tableAsDoubleArray }` TODO: external cases
• getKB for condition like `y = (k * x) + b` by `{ x1, y1, x2, y2 }`
• getCommonPointByBisectionMethod by `({ fn1, fn2, xMin = -1000, xMax = 1000, eps = 0.001 })`

### linear

This example description

``````          |
y2= 2     |                           o
|
y= ?      |             o
(1.5 will be found)
y1= 1     o
|
------------------------------------
x1= 0         x= 0.5        x2= 1
``````

### bilinear

This example description

``````          |   q12= 410                q22= 590
y2= 5     |   o                       o
|
|           q= ? (377.75 will be found)
y= 3.5    |           o
|
|   q11= 400                q21= 210
y1= 1     |   o                       o
------------------------------------
x1= 1   x= 3            x2= 6
``````

### byInternalTable

Interpolate by table (only internal table values gives correct result) for example

### getCommonPointByBisectionMethod

This example description

``````          |
y2= 2     o                           o
|
y= ?      |             o
(~1.5 will be found)
y1= 1     o                           o
|
------------------------------------
x1= 0         x= ?          x2= 1
(~0.5 will be found)
``````

## Commands

• `npm run clean` - Remove `lib/` directory
• `npm test` - Run tests with linting and coverage results.
• `npm test:only` - Run tests without linting or coverage.
• `npm test:watch` - You can even re-run tests on file changes!
• `npm test:prod` - Run tests with minified code.
• `npm run test:examples` - Test written examples on pure JS for better understanding module usage.
• `npm run lint` - Run ESlint with airbnb-config
• `npm run cover` - Get coverage report for your code.
• `npm run build` - Babel will transpile ES6 => ES5 and minify the code.
• `npm run prepublish` - Hook for npm. Do all the checks before publishing your module.

## Keywords

### Install

`npm i math-interpolate`

4

5.0.0

MIT

27.1 kB

55