cardinal-spline
Advanced tools
Comparing version 0.0.0 to 0.0.1
{ | ||
"name": "cardinal-spline", | ||
"main": "index.js", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"homepage": "https://github.com/stbaer/cardinal-spline", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -5,5 +5,4 @@ /** | ||
* Calculates an array containing points representing a cardinal spline through given point array. | ||
* Points must be arranged as: [x1, y1, x2, y2, ..., xn, yn]. | ||
* | ||
* @param {Array} points - point array | ||
* @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 | ||
@@ -98,2 +97,2 @@ * @param {Number} [numOfSeg=25] - number of segments between two points (line resolution) | ||
return res; | ||
}; | ||
}; |
{ | ||
"name": "cardinal-spline", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "cardinal spline function / browserify module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# cardinal-spline | ||
` var splinePoints = cSpline(points, tension, numOfSeg, close) -> 1D number array` | ||
## Install | ||
[![NPM](https://nodei.co/npm/cardinal-spline.png?downloads=true)](https://nodei.co/npm/cardinal-spline/) | ||
`npm install cardinal-spline` | ||
or with bower: | ||
`bower install cardinal-spline` | ||
## Use | ||
```js | ||
var cSpline = require('cardinal-spline'); | ||
var splinePoints = cSpline(points[, tension, numOfSeg, close]); | ||
//-> splinePoints is a flat Float32Array, [x1, y1, x2, y2, ..., xn, yn] | ||
``` | ||
### Options | ||
```js | ||
/** | ||
* @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 |
6852
39