{"_id":"points-on-curve","_rev":"6-1d7d6c0dc1a94604f0deea27a8850a19","name":"points-on-curve","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"points-on-curve","version":"0.0.1","description":"Estimate points on a bezier curve or a set of connexted bezier curves","main":"lib/index.js","module":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"rm -rf lib && tsc","lint":"tslint -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/bezier-points.git"},"keywords":["Bezier","graphics"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/bezier-points/issues"},"homepage":"https://github.com/pshihn/bezier-points#readme","devDependencies":{"tslint":"^6.1.1","typescript":"^3.8.3"},"gitHead":"e88a964a1122ffef96b8cc453cc414a6c80a8c1e","_id":"points-on-curve@0.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AncNOQnNKzCJBGPW/+PLFCLvWMFoemwR+1D1QTPY8HFhiz42sNtRClR52AuejId3Rv6p3SvUogfJGtygk9MaYg==","shasum":"08746a0274ec28bfd8e8454745573deca3583225","tarball":"https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.0.1.tgz","fileCount":8,"unpackedSize":11254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekN6PCRA9TVsSAnZWagAAf/wP/iNP1XYQAGx/igdwzO7Z\nQY+/bkBAS8ZHuMRr9zLSf7bYdTbEE23UeGL6Rb5u2QeylONmxUk0Hb5TI0/y\n2slyN51q3ZhHrJONEvUFurQLBRI9tJfU0YO+CPx7zcfzQCRj7r43nAzxjjZh\nuA5Ms4HxATSj8oIgTSzjOiH8zZ4quYFH146ceoXuQkJGftqOsQtInbMaHJoF\n04Rp21qUxZ1eV+ZQPHysgotbrxKNZO82hanEhtwc0Fk39opVKbo7fRXSvf+v\n0MKZoTEN22oc6YAdqkHD8RvZDKUmZXO0dPmpxlRPGjNoZ2hi/LETzfiIgulN\nl9ctrSDMLpLDWuyFlGrsLdbylH2KqaxhRUp8a0fKL8xaoVzBQCvD2Hvr7C7+\nTNnjqqfr6VXZOBDnHfW48t1tc7kxJ2tlwrraY8nthu5k8b1iWdVAGz9KFemW\nje7jdoraUe9H0DlI/YEbwJ5DdQp+aorJYDBO1K0m/yH/A5eJpLY14aUyGOGg\ncIKlhIuLiYEHYTG4tP8xBFp8lHaR/pmzFjnmagwMbW5qFMUGSySQCBGc7xmi\n4Pdn/3XULnZx2kvSMsKpG44rozv5zZfZJ+zlm6THbmzsk4zFIkLYSP8iuiZe\nwXHjEmvHWRMcJqCUdIYGKd1jgZvAuhK07eKmaggcNg+ITxNfT2GiC7bs9eNJ\nfZAv\r\n=Dl5P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICAFenQuLPRdz58dZakGVkA3kfscGmIUXyuZZICvV66HAiAAihdm1ikkhAmebukFUJpUER0Pbb3dQM48MoaEI1EMqQ=="}]},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/points-on-curve_0.0.1_1586552462508_0.42877750227986366"},"_hasShrinkwrap":false},"0.1.0":{"name":"points-on-curve","version":"0.1.0","description":"Estimate points on a bezier curve or a set of connexted bezier curves","main":"lib/index.js","module":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"rm -rf lib && tsc","lint":"tslint -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/bezier-points.git"},"keywords":["Bezier","graphics"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/bezier-points/issues"},"homepage":"https://github.com/pshihn/bezier-points#readme","devDependencies":{"tslint":"^6.1.1","typescript":"^3.8.3"},"gitHead":"6bda64fc576dc7ac2f6bd685708219e14dfb2a4c","_id":"points-on-curve@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-odvXCvkW6kuV+3oQF00Jl1GtM0qOLuYtQUXgODfCDVNe9mM6xDkQLGLAQcic8hL3EDdAvvTtMgG6WHJEuTkS0w==","shasum":"2c4cef65a05d81dde67a6f4e282603b7a56b0d75","tarball":"https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.1.0.tgz","fileCount":11,"unpackedSize":18005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekif+CRA9TVsSAnZWagAAjcEP+QDFxLMkvlA+EyNOLryR\n0UpY9ItDdbBQjPktHNUq3IVwqtgg+x42w3vlZQQv5MkejYP3ERXIiq3txpJ6\nk1yIn9vDCqVEmD4CQA+16VapUyKNgp/vjObd4wZBl8XlNq5B7rVW2xgzT5tT\nu0nzghMn7o1ZUIU+UwKw7LSeiUIvNM4v8bczQljzfXlwBlkEtiUbqjtLLJdI\nsISVc6pOvERunjG1pEyGCRCwK/RxhYFnYFk6G5MiV59vtKr8mvscqHBLPkza\nyUfU0jvjbBgoCF+G1rNsfA9QU9/0cfDVTgnjq0OffHpCPZ+J7xscnuH0a+9K\nlShzw6CiDbh51ZwdqMQhoxbWtxa9DrquiAMy0AW2ngVQYfQWnxF98SKhn+Es\nmWMNv4/wFckwBBZsLOBSyzXIytxDgVtO6PboV9Zd4E0f+jyq1di2dhcY6uRt\nS+fTbitSkHrIGz24LpBAm0qVNhP4xFlW6aeK1tWHk+7CIJE0m1WhRJVBhyaI\nH2fQZ8kuEd4D5kGX6YgIijHWGmDAOTdBPEQFNiRVW3uXpZqNYleLhUDjyTO4\nz4V0uzj+qBn7QWn0WgdpsE3TFAAQjYbzP8z6qqfRHm+9u4X6A/pJll/2DOLr\nqwZIdYwO9Fh7PGrDnkz1bYDAuJn518TrGiTBfVa7TZwBfH8p2uL5EkuLS19+\nL0+9\r\n=wqRq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCV0f7aJe8kVABLBXnGt9Wev5ACMjWEXFB5XJJ/4zZpTQIgFlHsCrZ2C3bjwWnmvxDs1RAP2wjTyKvGA1dFKpQbGAk="}]},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/points-on-curve_0.1.0_1586636797996_0.12113682823191585"},"_hasShrinkwrap":false},"0.1.1":{"name":"points-on-curve","version":"0.1.1","description":"Estimate points on a bezier curve or a set of connexted bezier curves","main":"lib/index.js","module":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"rm -rf lib && tsc","lint":"tslint -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/bezier-points.git"},"keywords":["Bezier","graphics"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/bezier-points/issues"},"homepage":"https://github.com/pshihn/bezier-points#readme","devDependencies":{"tslint":"^6.1.1","typescript":"^3.8.3"},"gitHead":"a3851717b902dc1b93f6738c590455f06fa4d82c","_id":"points-on-curve@0.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Fsm7XFYZcAX2uyneDWzo3GbLEc91MJidr+COxW7/Z+yWJzOZSuqJ11kZtOjXIbLNXvkPZ3j913NNeWjZ+aHW4A==","shasum":"2ed4e20138e84e3bc46a7f044b5e41dd875ae396","tarball":"https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.1.1.tgz","fileCount":11,"unpackedSize":18077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelAgVCRA9TVsSAnZWagAA+gsQAITqaKJkSJa+fXhcH3/A\nY/Hp6xpgXyXX2EpSZFWalsw/I025p7sYgVSf7tz39iaMt6ekit86S5KpxYxk\nS2gjdxatepgRNu/B6HUJEJI2FXrEzCTxJ2vWnJzF4Mwbtub4rF4nArubnFtO\nP/lrWbVSeukVp2ENNamgeBJeKAPxJ2rPpxVPTyESAmJZDlILS4n90zPoVZeU\ncVqk9knqVIlVXcVFFLAGxG7kLrjRwM6gZOiKd4Rh6E2EffGDkGzPDxxQG+tz\neSt1HguN6EH6Lo7u0tkuuVHtEM54m5b5Ob94y3xX2bSV+uNUn3fp9xCWJhd4\ntWkr4xCbfEZ7NdQ8cHSuHA8GhstTCAISOXn5KhnVpgN8wBZmfIQDj/6b8tH/\nPy9AfBQM9bktyi91Nq79U3NNhdRujNayiz0FOZ4Q8rKmg9hZJKaW9rYWnBoF\nHEzGb4gBOXkES9MKleYTlPJ1WurdPEZyxmFfr6fx/2AmTUQNBHezdMGzmn7l\nCS107vQKMXtWQ8o7SHVc6sddsnzG04c6lZSeVjbuBA1hFfid622tnTjgVh6o\nkAk3hEGbp1LGRPVU/H4EUMic+8wf7MZKOBF7/UpQ2rjUvchB4SAa4tTzKIZg\nqpQpaysSo6/V6zGW1RGIRLUz/QItPb3EX1/T9LOdQIs2tDqW/QE9tdeOlzfr\n7O4F\r\n=gDaa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYb6OgaapbJfMwsLxlmDB8Mm1Va/Av2qTlKvIl0gq1PAiEAwk324fslX7hK+35ZDIcp0M9Ngi8YuR+dd+ej0jk1Lc8="}]},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/points-on-curve_0.1.1_1586759700717_0.9900181259956877"},"_hasShrinkwrap":false},"0.2.0":{"name":"points-on-curve","version":"0.2.0","description":"Estimate points on a bezier curve or a set of connexted bezier curves","main":"lib/index.js","module":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"rm -rf lib && tsc","lint":"tslint -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/bezier-points.git"},"keywords":["Bezier","graphics"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/bezier-points/issues"},"homepage":"https://github.com/pshihn/bezier-points#readme","devDependencies":{"tslint":"^6.1.1","typescript":"^3.8.3"},"gitHead":"48241476eb86307294f54913ccfb60a3e7338c56","_id":"points-on-curve@0.2.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==","shasum":"7dbb98c43791859434284761330fa893cb81b4d1","tarball":"https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz","fileCount":11,"unpackedSize":18400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeljmICRA9TVsSAnZWagAAMrQP/jUnKMRB60d+es4oNOMp\nvJcmm96pA9Ij7AssoRCaI3lJm0/uI+fQBjfKLW3WS6HHBxFmm/bYFZcLIMEw\n5SGzErvuJ9LNNpAvJ9xA5KS8mJyhX1mXKHbUK9NUZ3SI34989zZ2sZZuwvNz\nMLJc7FryyWDPGLYZ7sX3aeWJbVXTuweKICVqJbU6SDuGEjuec4pdeHDird4N\nlSQSlDNWifXVT6cSz/Vg/b3ixRXDv/RoyLwuPfsiCrwsczsAtaacmIaJHpEq\niRKIXPdy2I4tuiwrKzRujcqmvPLHmsbypkzb9Fw7BdlCxSW39MIf2NC9xq6Y\nTnpn4o0j3DZ1Ri08zrc4zRjeY5OdI9qTyiXSDGntub6Y24oAdPMQAo2NJyNQ\nJGSjC7JmldzVagTGw5cYf++Z8ugpbIdZN1TYBOH63G3wbiufrU7vIN+z0roL\nGdlfOf5p5D6llvJdopoIs7wgW5Jd6xD27R9ZwzphZ3z097nmuK2BjjCromOD\nU9in/ZGd1pkasO/xC60xBEoMomrASFqd+S0gEbgVtjAjLwkUV9nGooQdEdbr\nAdbQyCWakUjXqEipWzyNpMe2HuAlfMAOM5N8EvODBSc0KdezDgLR7Ay6qSrE\nFJDNpwlbzffTj+z03koXGK4DCw1y3HFF/0J3x/vuuIlBpy4COsz4F3JLlXsL\nyx1l\r\n=Bay2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxHyHRANf1GVRVejWVshZ9Zidc+2kT7RnALYI214+rXAiBrWZyt1vXw5mzfJLrRxfeMrVm8YO5Wlc5P16l/ZFwtmA=="}]},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/points-on-curve_0.2.0_1586903432428_0.03147317875806577"},"_hasShrinkwrap":false},"1.0.0":{"name":"points-on-curve","version":"1.0.0","description":"Estimate points on a bezier curve or a set of connexted bezier curves","main":"lib/index.js","module":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"rm -rf lib && tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/bezier-points.git"},"keywords":["Bezier","graphics"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/bezier-points/issues"},"homepage":"https://github.com/pshihn/bezier-points#readme","devDependencies":{"typescript":"^4.5.5"},"gitHead":"a65a82cb19a1b8be4b13fabc174e5704837a4d32","_id":"points-on-curve@1.0.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-5RXAghb/GI+u96jzhXzHflA2qYgC/mXNsjUGXSlcPSQZHNe+xJSo32L3Kb7XD7tPrmYZOTed5F/7UaWNjY6lwg==","shasum":"ed9c86c72dca03e6539dc63c53f876e33d462dfa","tarball":"https://registry.npmjs.org/points-on-curve/-/points-on-curve-1.0.0.tgz","fileCount":10,"unpackedSize":17319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBAHGCRA9TVsSAnZWagAALWIP/0N/OGoNfBLkR+lGAgzJ\n9PUkt5QVJaPP++vt9IKEYq8lyvItyNPLMlgKya66atW17TpkZxW+1YonSqeP\n2qJwminRZ8krLsF1XtX7mMsmpBzvLh2+G4QKrXEYUDun6wIdLkD4L/d8oj11\n781h7WQkPiCYA+RH4d4zCAH9n8M9bowY3f6cBoENSFEbvm6KogecOkFXaiL0\noZ7WjKgAiTMYAqs93CL+LJe87Kd4FfEkyY2AZcaZGznMd0t2w8nRwppH4LSw\npaK90g9e73xpk0Px1OYKavD4vwh5YgD4NNvnFajplbZyLNC5VxO23KdiIOAw\neFVv2q2Tu4gAJ73tjXdohMXKQR2JMmuR86ooMkNWTDesfdfQTxVndE6RLky1\nB5zwMBIeMK+D/fW9hTAl8bvI+XgnkvS7aCcQdHGGWmyARb3L59QMOKjJMwXp\njiRR6ZuoujHsAXmrUgEFNzlrvJEefI3T0MTbogVLvnMslgQexPm32Jli2dp3\nufbYYPjShmHL9I0/5dlxRiX1Fd4laXVXJ+kL4L4IU2dUg/b+8LvptagG1jCj\nSibDa9DxawtrWpqwvQQsuQ5rBswas7xUD/SFwSm3nChYzs0G+Pq2hsy3Z0g/\nlm/wxwUKPyM1NJh4F2WXEcjdSOY0+39x3uoBLnhGSq3uJlerfchrv3tbscPd\nRKoH\r\n=c8Yr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs/2EKvsJpAYVFJrwQPF/npUcXRbzpqhTVlKn7L6zNogIgamSwVFLd0wVaSR+Kmi0vn35cmZ1ZMo1EqzWta4RaF5I="}]},"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/points-on-curve_1.0.0_1644429766124_0.620069085525309"},"_hasShrinkwrap":false},"1.0.1":{"name":"points-on-curve","version":"1.0.1","description":"Estimate points on a bezier curve or a set of connexted bezier curves","main":"lib/index.js","module":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"rm -rf lib && tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/pshihn/bezier-points.git"},"keywords":["Bezier","graphics"],"author":{"name":"Preet Shihn"},"license":"MIT","bugs":{"url":"https://github.com/pshihn/bezier-points/issues"},"homepage":"https://github.com/pshihn/bezier-points#readme","devDependencies":{"typescript":"^4.5.5"},"gitHead":"00d0a7de7dc4b6e4aab70d670afa21c4a6c6b77a","_id":"points-on-curve@1.0.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-3nmX4/LIiyuwGLwuUrfhTlDeQFlAhi7lyK/zcRNGhalwapDWgAGR82bUpmn2mA03vII3fvNCG8jAONzKXwpxAg==","shasum":"03fcdc08e48e3bfdc7e8bd1d7ccd4d5f11e132c6","tarball":"https://registry.npmjs.org/points-on-curve/-/points-on-curve-1.0.1.tgz","fileCount":10,"unpackedSize":17465,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZ6zyV9A229q1PyoKeTQbeKhvkRlkceOq8MapwYO8ZjAiBKZ581+g2M73s5qR6rPjVtIKyxyz5KW1+XjVOPvJs2OA=="}]},"_npmUser":{"name":"shihn","email":"preetshihn@gmail.com"},"directories":{},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/points-on-curve_1.0.1_1695500550309_0.14023367942668918"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-10T21:01:02.508Z","0.0.1":"2020-04-10T21:01:03.255Z","modified":"2023-09-23T20:22:30.673Z","0.1.0":"2020-04-11T20:26:38.117Z","0.1.1":"2020-04-13T06:35:00.848Z","0.2.0":"2020-04-14T22:30:32.582Z","1.0.0":"2022-02-09T18:02:46.275Z","1.0.1":"2023-09-23T20:22:30.501Z"},"maintainers":[{"name":"shihn","email":"preetshihn@gmail.com"}],"description":"Estimate points on a bezier curve or a set of connexted bezier curves","homepage":"https://github.com/pshihn/bezier-points#readme","keywords":["Bezier","graphics"],"repository":{"type":"git","url":"git+https://github.com/pshihn/bezier-points.git"},"author":{"name":"Preet Shihn"},"bugs":{"url":"https://github.com/pshihn/bezier-points/issues"},"license":"MIT","readme":"# points-on-curve\n\nThis package calculate the points on a curve with a certain tolerance. It can also simplify the shape to use fewer points. \nThis can really be useful when estimating lines/polygons for curves in WebGL or for Hit/Collision detections. \n\n## Install\n\nFrom npm\n\n```\nnpm install --save points-on-curve\n```\n\nThe package is distributed as an ES6 module. \n\n## API\n\n### pointsOnBezierCurves(points: Point[], tolerance?: number, distance?: number): Point[]\n\nYou pass in the points representing a bezier curve. Each point is an array of two numbers e.g. `[100, 123]`.\n\nThe points can also be a set of continuous curves where the last poing on the `Nth` curve acts as the first point of the next. \n\n```javascript\nimport { pointsOnBezierCurves } from 'points-on-curve';\n\nconst curve = [[70,240],[145,60],[275,90],[300,230]];\nconst points = pointsOnBezierCurves(curve);\n// plotPoints(points);\n```\n\n![points on bezier](https://user-images.githubusercontent.com/833927/79051836-45630300-7be7-11ea-8cb6-cba2695a4807.png)\n\nSame can be rendered with more **tolerance** (default value is 0.15):\n\n```javascript\nconst points = pointsOnBezierCurves(curve, 0.7);\n```\n![points on bezier with 0.7 tolerance](https://user-images.githubusercontent.com/833927/79051837-45fb9980-7be7-11ea-9583-52cf882e770e.png)\n\nNote that this method does not accept the number of points to render, but takes in a tolerance level which allows for better distribution of points. \n\nThe value of **tolerance** can be between 0 and 1. It is used to decide how many points are needed in a section of the curve. The algorithm determined the *flatness* of a section of the curve and compares it to the *tolerance* level, if less flat, the segment gets further divided into 2 segments. \n\n\n#### Simplifying path\n\nBased on the tolerance alone, this algorithm nicely provides enough points to represent a curve. It does not, however, efficiently get rid of unneeded points. The second *optional* argument in function, **distance** helps with that. If a `distance` value is provided, the method uses the [Ramer–Douglas–Peucker algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm) to reduce the points. \n\n```javascript\nconst points = pointsOnBezierCurves(curve, 0.2, 0.15);\n```\n\nFollowing are the points generated with distance values of `0.15`, `0.75`, `1.5`, and `3.0`\n\n![points with 0.15d](https://user-images.githubusercontent.com/833927/79051853-53b11f00-7be7-11ea-8970-7cc3f7621142.png)\n![points with 0.75d](https://user-images.githubusercontent.com/833927/79051854-5449b580-7be7-11ea-9601-a1dd418b10d8.png)\n![points with 1.5d](https://user-images.githubusercontent.com/833927/79051855-5449b580-7be7-11ea-9ab4-139beb0faf11.png)\n![points with 3.0d](https://user-images.githubusercontent.com/833927/79051856-54e24c00-7be7-11ea-9f52-34e3ad9c81bd.png)\n\n### curveToBezier(pointsIn: Point[]): Point[]\n\nSometimes it's hard to think of shape as a set of cubic bezier curves, each curve with 2 controls points. It is simple to just think of them as a curve passing through a set of points. \n\nThis method turns those set of points to a set of points representing bezier curves.\n\n```javascript\nimport { curveToBezier } from 'points-on-curve/lib/curve-to-bezier.js';\n\nconst curvePoints = [\n  [20, 240],\n  [95, 69],\n  [225, 90],\n  [250, 180],\n  [290, 220],\n  [380, 80],\n];\nconst bcurve = curveToBezier(curvePoints);\n// .. Plot bcurve\n```\n![Curve through points](https://user-images.githubusercontent.com/833927/79051797-12b90a80-7be7-11ea-92d2-5cb79adcbe30.png)\n\nNow that we have bezier points, these could be passed to `pointsOnBezierCurves` function to get the points on the curve\n\n![Curve through points](https://user-images.githubusercontent.com/833927/79051798-1351a100-7be7-11ea-8465-959a22b72371.png)\n\n\n## License\n[MIT License](https://github.com/pshihn/bezier-points/blob/master/LICENSE)\n\n","readmeFilename":"README.md"}