npm.io
1.0.0 • Published 11 years ago

bezier-curve

Licence
MIT
Version
1.0.0
Deps
0
Vulns
0
Weekly
0
Stars
13

bezier-curve

Bezier curve interpolation

Bezier curve interpolation of any order of control points of any dimensionality. Uses the De Casteljau algorithm. Though this module may be useful for educational purposes, for a faster alternative check this.

Install

$ npm install bezier-curve

Usage

var bezier = require('bezier-curve');

var points = [
  [-1.0,  0.0],
  [-0.5,  0.5],
  [ 0.5, -0.5],
  [ 1.0,  0.0]
];

for(var t=0; t<1; t+=0.01) {
  var point = bezier(t, points);
}

Keywords