1.1.2 • Published 8 years ago

lagrange-promise v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

lagrange-promise

NPM npm version wercker status

lagrange-promise is a Node.js module for computing Lagrange with Promise API.

https://www.npmjs.com/package/lagrange-promise

Installation

$ npm install lagrange-promise

API

Methods

constructor(x1, x2, y1, y2)

const Lagrange = require('./Lagrange');
const lagrange = new Lagrange(0, 0, 1, 1);

valueOf(x)

Calculate Lagrange(x).

lagrange.valueOf(3)
    .then(val => {
        console.log(val);
    });

addPoint(x, y)

Add a new point.

lagrange.addPoint(x, y)
    .then(addedPoint => {
        console.log(addedPoint);
    });

addMultiPoints(array)

Add multiple points with addPoint(x, y).

const points = [
    [0, 0],
    [30, 35],
    [82, 90],
    [128, 130],
    [200, 220],
    [255, 250]
];
lagrange.addMultiPoints(points)
    .then(arr => {
        console.log(lagrange);
    });
1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago