1.0.0 • Published 9 years ago

bezier-curve v1.0.0

Weekly downloads
40
License
MIT
Repository
github
Last release
9 years ago

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);
}