Package Exports
- cardinal-spline
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cardinal-spline) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
cardinal-spline
Install
npm install cardinal-spline
or with bower:
bower install cardinal-spline
Use
var cSpline = require('cardinal-spline');
var splinePoints = cSpline(points[, tension, numOfSeg, close]);
//-> splinePoints is a flat Float32Array, [x1, y1, x2, y2, ..., xn, yn]
Options
/**
* @param {Array} points - (flat) point array: [x1, y1, x2, y2, ..., xn, yn]
* @param {Number} [tension=0.5] - tension. Typically between [0.0, 1.0] but can be exceeded
* @param {Number} [numOfSeg=25] - number of segments between two points (line resolution)
* @param {Boolean} [close=false] - Close the ends making the line continuous
* @returns {Float32Array} - the spline points.
*/
License
MIT