{"_id":"bezier","_rev":"455952","name":"bezier","description":"n-degree Bezier interpolation","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"time":{"modified":"2024-06-20T02:26:07.000Z","created":"2013-09-30T02:59:03.141Z","0.1.0":"2013-10-01T02:09:41.328Z","0.0.1":"2013-09-30T03:10:17.151Z","0.0.0":"2013-09-30T02:59:03.141Z"},"users":{},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://github.com/hughsk"},"repository":{"type":"git","url":"git://github.com/hughsk/bezier"},"versions":{"0.1.0":{"name":"bezier","description":"n-degree Bezier interpolation","version":"0.1.0","main":"index.js","browser":"index.js","dependencies":{},"devDependencies":{"tape":"~1.1.1"},"scripts":{"test":"node test.js"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://github.com/hughsk"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/bezier"},"bugs":{"url":"https://github.com/hughsk/bezier/issues"},"keywords":["bezier","curve","spline"],"readmeFilename":"README.md","_id":"bezier@0.1.0","dist":{"shasum":"fad143502b21e378a3181ffe50baac97ad24909e","tarball":"http://registry-npm.ywwl.com/bezier/download/bezier-0.1.0.tgz","integrity":"sha512-2XI2zrtf+NBiIkcAjXwtZ+fWMT5p/5x8DXwSltCxDTOQXyh0bgJ+Llbt8WvTcR1SRhAF38ei6S585GrTXI65sQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPSPsm/YBfPTC3wh07jBVAJO13UMwCZlZExyAK4r4uMwIgSI7fNuOV0Gf98vQ/yJaupXa7+MGd+Tso25+sa7HnM7A="}],"size":2952,"noattachment":false,"key":"/bezier/-/bezier-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"publish_time":1380593381328,"_cnpm_publish_time":1380593381328},"0.0.1":{"name":"bezier","description":"n-degree Bezier interpolation","version":"0.0.1","main":"index.js","browser":"index.js","dependencies":{"choose":"0.0.0"},"devDependencies":{},"scripts":{},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://github.com/hughsk"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/bezier"},"bugs":{"url":"https://github.com/hughsk/bezier/issues"},"keywords":["bezier","curve","spline"],"readmeFilename":"README.md","_id":"bezier@0.0.1","dist":{"shasum":"5104473015c658e5c403be1d4ff22a4e7cc6f435","tarball":"http://registry-npm.ywwl.com/bezier/download/bezier-0.0.1.tgz","integrity":"sha512-kS6i4vlY8df7qAt72CMe4rC5MnsjvcIGlbcfTsfeNh7fpRLRKWsgo8DHHsJ6TOTuDLDePjNyplxao4r/M5klSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/D//OUZIJYTOFxMEmd4RfBYk8dR5Kq1Lyl4tgyljkrAIhAOR2VkSd0711Q2MpuDUH0jgQnNfTmIT17yxj/0vk+thW"}],"size":1924,"noattachment":false,"key":"/bezier/-/bezier-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"publish_time":1380510617151,"_cnpm_publish_time":1380510617151},"0.0.0":{"name":"bezier","description":"n-degree Bezier interpolation","version":"0.0.0","main":"index.js","browser":"index.js","dependencies":{"choose":"0.0.0"},"devDependencies":{},"scripts":{},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://github.com/hughsk"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/bezier"},"bugs":{"url":"https://github.com/hughsk/bezier/issues"},"keywords":["bezier","curve","spline"],"readmeFilename":"README.md","_id":"bezier@0.0.0","dist":{"shasum":"58755ed444f6a3eb751df9f8e2ce831599833885","tarball":"http://registry-npm.ywwl.com/bezier/download/bezier-0.0.0.tgz","integrity":"sha512-7FNL8dsXwOmwAkQYIVpQjtLJBx0nbO7b08S77d08qo+NOttyZ+YCBhxeh0lxeoegI52vYTs7+6sgcNfBRnmc9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6ILVgwjsYKV+5NnQBNMpnL4wpnyr/1w5Ue94T/kd21AiEAq/wuIXT4Rtbnh5oHBAQgEaAowwnf1fSxavKAXAinG04="}],"size":1860,"noattachment":false,"key":"/bezier/-/bezier-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"publish_time":1380509943141,"_cnpm_publish_time":1380509943141}},"readme":"# bezier [![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #\n\nn-degree Bezier curve interpolation.\n\n## Usage ##\n\n[![bezier](https://nodei.co/npm/bezier.png?mini=true)](https://nodei.co/npm/bezier)\n\n### `require('bezier')(points, t)` ###\n\nReturns the value at `t` for a bezier curve of `points.length` degrees.\nIn other words, if you pass it a 3-element array you'll get the results of a\n3-degree (quadratic) curve.\n\n``` javascript\nvar bezier = require('bezier')\nbezier([0, 1, 2], 0.5)    // 1\nbezier([0, 1, 2, 3], 0.5) // 1.5\n```\n\nYou can use a curve for each dimension to get the resulting bezier you're\nprobably familiar with:\n\n``` javascript\nvar canvas = document.createElement('canvas')\nvar ctx = canvas.getContext('2d')\n\nvar bezier = require('bezier')\nvar x = [0, 1, 2]\nvar y = [2, 1, 0]\n\nctx.beginPath()\nctx.strokeStyle = '#000'\nfor (var t = 0; t < 1; t += 0.01) {\n  ctx.lineTo(bezier(x, t), bezier(y, t))\n}\nctx.stroke()\nctx.closePath()\n```\n\n### `curve = require('bezier').prepare(pointCount)` ###\n\nGenerates a function which takes `pointCount` number of points to draw a\nbezier curve. For higher values of `pointCount`, this function is generated on\nthe fly such that it can run with as little overhead as possible.\n\nIt's a small trade-off in flexibility for a small benefit in performance :)\n\n### `curve(points, t)` ###\n\nGiven an array of `points` that is `pointCount` long, return the value across\nthe curve at `t`.\n\n``` javascript\nvar quadratic = require('bezier').prepare(3)\nvar cubic = require('bezier').prepare(4)\n\nquadratic([0, 1, 2], 0.5) // 1\ncubic([0, 1, 2, 3], 0.5)  // 1.5\n\n// Note that these functions expect\n// arrays of the correct length:\nquadratic([0, 1, 2, 3], 0.5) // 1\nquadratic([0, 1], 0.5)       // NaN\n```\n\n## License ##\n\nMIT. See [LICENSE.md](http://github.com/hughsk/bezier/blob/master/LICENSE) for details.\n","_attachments":{},"readmeFilename":"README.md","bugs":{"url":"https://github.com/hughsk/bezier/issues"},"license":"MIT"}