provides values from a 'curved' set
provides values from a 'curved' set. See the examples:
var curve curveArrsteps = 20loopsteps = 19;// build values from -100 to 100, 'slow' at the beginningcurve = curved-100 100 'bgn';curveArr = ;for var i = 0 percent; i < steps; i++curveArrpushcurvei / loopsteps;console.logcurveArrjoin',';// -100,-100,-100,-99,-98,-96,-94,-90,-85,-79,-71,-61,-50,-36,-20,-2,19,43,70,100// build values from -100 to 100, 'slow' at the endcurve = curved-100 100 'end';curveArr = ;for var i = 0 percent; i < steps; i++curveArrpushcurvei / loopsteps;console.logcurveArrjoin',';// -100,-70,-43,-19,2,20,36,50,61,71,79,85,90,94,96,98,99,100,100,100
There is no error handling. The first two parameters to
curved must be numbers or the script will break.
curved may be downloaded directly or installed through
$ npm install curved
$ git clone
to run tests, use
npm test from a shell.
$ npm test
(The MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.