{"_id":"@brendangooch/bezier","_rev":"2-cb8ec4a83ac82075fa44698e7da4e56f","name":"@brendangooch/bezier","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@brendangooch/bezier","version":"1.0.0","keywords":[],"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","_id":"@brendangooch/bezier@1.0.0","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"homepage":"https://github.com/brendangooch/bezier#readme","bugs":{"url":"https://github.com/brendangooch/bezier/issues","email":"brendangooch@gmail.com"},"dist":{"shasum":"fb144b7a4d1641594763c1c462fa4539744976c5","tarball":"https://registry.npmjs.org/@brendangooch/bezier/-/bezier-1.0.0.tgz","fileCount":7,"integrity":"sha512-1yTwEYv3sQSaKhPrRcYeDb4sbt2IqJYFbr0rLgZ5SQBVw+ielcjdRB5UPnhcLfHEfRt36Y6dOPXF3VygYdXJ4A==","signatures":[{"sig":"MEQCIGPB1twSMTjcSzi7TyFeKPTqejhdMpHFcgcT8eqhwnzVAiAMGZVq2zFW9jxxfxMttl4b8elV+HU71Dl6YM/Cy4iQoA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6976},"type":"module","types":"./lib/index.d.ts","exports":{".":"./lib/index.js"},"gitHead":"83dd1800b18083bdd461e12e78b885f16a299c15","private":false,"scripts":{"build":"tsc -p tsconfig.prod.json","prepack":"npm run build","prebuild":"npm run remove-lib","remove-lib":"rm -rf lib"},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"repository":{"url":"git+https://github.com/brendangooch/bezier.git","type":"git"},"_npmVersion":"10.9.2","description":"a typescript class representing a bezier curve","directories":{},"_nodeVersion":"21.4.0","dependencies":{"@brendangooch/maths":"^4.0.1","@brendangooch/vector":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/bezier_1.0.0_1749147858335_0.9339072959803505","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@brendangooch/bezier","version":"2.0.0","description":"a typescript class representing a bezier curve","author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","type":"module","scripts":{"build":"tsc -p tsconfig.prod.json","prebuild":"npm run remove-lib","prepack":"npm run build","remove-lib":"rm -rf lib"},"private":false,"publishConfig":{"access":"public"},"exports":{".":"./lib/index.js"},"types":"./lib/index.d.ts","devDependencies":{"typescript":"^5.7.2"},"repository":{"type":"git","url":"git+https://github.com/brendangooch/bezier.git"},"homepage":"https://github.com/brendangooch/bezier#readme","bugs":{"url":"https://github.com/brendangooch/bezier/issues","email":"brendangooch@gmail.com"},"keywords":[],"dependencies":{"@brendangooch/maths":"^4.0.1","@brendangooch/vector":"^1.0.0"},"_id":"@brendangooch/bezier@2.0.0","gitHead":"e731c606c9da3fae59c44b278b161a9a10668744","_nodeVersion":"21.4.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-rOq+xmPO+Nrr7diPjLNL/IayVYNIdsfZVu246RkQO8jUvY/eOnU5JbQrYLCH/ErEO893DDim/t92vGs2lDTI6A==","shasum":"8a184b8ea8ceaa2b2bd6f4afa337e6156850f3db","tarball":"https://registry.npmjs.org/@brendangooch/bezier/-/bezier-2.0.0.tgz","fileCount":7,"unpackedSize":7001,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGfTH08FjKzYmAmM31fZ+ZZDtmASOa4st3Wx0l7D0KSkAiByP0CKvu6PIw2RJvoiUteh1kaPYeJjkqGPNo57M4XJPw=="}]},"_npmUser":{"name":"brendangooch","email":"brendangooch@gmail.com"},"directories":{},"maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bezier_2.0.0_1749568832924_0.7472310605826298"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-05T18:24:18.205Z","modified":"2025-06-10T15:20:33.284Z","1.0.0":"2025-06-05T18:24:18.502Z","2.0.0":"2025-06-10T15:20:33.115Z"},"bugs":{"url":"https://github.com/brendangooch/bezier/issues","email":"brendangooch@gmail.com"},"author":{"name":"B Gooch","email":"brendangooch@gmail.com"},"license":"MIT","homepage":"https://github.com/brendangooch/bezier#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/brendangooch/bezier.git"},"description":"a typescript class representing a bezier curve","maintainers":[{"name":"brendangooch","email":"brendangooch@gmail.com"}],"readme":"# bezier\na typescript class representing a bezier curve\n\nWith the QuadraticBezier class you can set 3 control points (start, control, end) and retrieve the any point on the bezier at any given t value between (and beyond) 0 - 1.\n\nYou can retrieve a rough approximation of the curve length and move to a distance on the curve rather than a t value.\n\nAdditionally, you can set the control point by angle (in radians) and distance from the start point or make the curve a straight line by calling makeStraight().\n\nFinally, you can also retrive a unit vector that is tangent to the curve at any given t value\n\n```typescript\n\n// basic usage\nconst bezier = new QuadraticBezier();\nbezier.setStart(100, 800);\nbezier.setEnd(800, 800);\nbezier.setControl(550, 100);\n\n// retriece the point 10% along the curve\nbezier.setT(0.1);\nconst x = bezier.x;\nconst y = bezier.y;\n\n// retrieve the tangent vector of the curve at 10%\nconst tangent = bezier.tangent\n\n// move along the curve by distance instead of t for more accurate traversal\nbezier.refreshLookup();\n\n// get total length\nconst length = bezier.length;\n\n// move 500 units along the curve\nbezier.setDistance(500);\nconst x = bezier.x;\nconst y = bezier.y;\n\n// set control point as an angle and distance away from the start point\nbezier.setStart(100, 800);\nbezier.setEnd(800, 800);\nbezier.setControlByAngleDistance(Math.PI / 2, 500); // 90 degress, 500 units away\n\n// make the bezier a straight line (much more efficient to use a Vector)\nbezier.setStart(100, 800);\nbezier.setEnd(800, 800);\nbezier.makeStraight();\n\n```","readmeFilename":"README.md"}