{"_id":"2d-math-utils","_rev":"3-5c9bac257b34c0c490bdad3347552a80","name":"2d-math-utils","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"2d-math-utils","version":"1.0.0","keywords":["math","2d","geometry"],"author":"","license":"MIT","_id":"2d-math-utils@1.0.0","maintainers":[{"name":"abeall","email":"contact@abeall.com"}],"dist":{"shasum":"81d57458d64e914d0fa26bbca74a24eb03dbfcb9","tarball":"https://registry.npmjs.org/2d-math-utils/-/2d-math-utils-1.0.0.tgz","fileCount":17,"integrity":"sha512-5fII5OGZYew5T8VcJEpaQSMLB107tlhyIVDwF5zEIrK4APa7l9v/okNtG40/t7G4K3t/LIut9p8863G02FyAPg==","signatures":[{"sig":"MEQCHwWLf+6pO8gWsHP7zvTviKd0FfJUUki/20xxxFe7hykCIQDxYOvv7YarLAnkZf4u0PaKKfdoYIQbNyMuzlGISJnR5w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66622},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"6b2a15b9f7d196d00aa3703ab97803daa148e02f","scripts":{"test":"jest","build":"tsc","build:demo":"parcel build demo/index.html --dist-dir docs --public-url ./","start:demo":"parcel serve demo/index.html --dist-dir .parcel-cache/demo","test:watch":"jest --watch","prepublishOnly":"npm run build"},"_npmUser":{"name":"abeall","email":"contact@abeall.com"},"_npmVersion":"10.8.2","description":"2D math utilities library","directories":{},"_nodeVersion":"20.18.0","dependencies":{"lit-html":"^2.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.2","parcel":"^2.9.3","ts-jest":"^29.1.1","typescript":"^5.1.6","@types/jest":"^29.5.3"},"_npmOperationalInternal":{"tmp":"tmp/2d-math-utils_1.0.0_1744992636004_0.18736486744994973","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"2d-math-utils","version":"1.0.1","keywords":["math","2d","geometry"],"author":"","license":"MIT","_id":"2d-math-utils@1.0.1","maintainers":[{"name":"abeall","email":"contact@abeall.com"}],"dist":{"shasum":"37bf01da3fb87c1ea3496f68f136359264768a01","tarball":"https://registry.npmjs.org/2d-math-utils/-/2d-math-utils-1.0.1.tgz","fileCount":18,"integrity":"sha512-2pmSecWCGB+44NfThQH3NjQWOs9xI/3f09By2Q5qbunYSAPyDepg4TnuwXSE8DAhaar5EDk+Ey5D+iFeh/KUzQ==","signatures":[{"sig":"MEQCIFfPPKqw5JFl4Pi6lk8CD4M4xOV8ehkeTzIptD8UKZJjAiBCI6xn+Xp7DHaWYtH988X7HnMVNwrkD+1ifqKdQT3/1w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68882},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f796a04d112668b2fb33bfcafacc62b10502585d","scripts":{"test":"jest","build":"tsc","build:demo":"parcel build demo/index.html --dist-dir docs --public-url ./","start:demo":"parcel serve demo/index.html --dist-dir .parcel-cache/demo","test:watch":"jest --watch","prepublishOnly":"npm run build"},"_npmUser":{"name":"abeall","email":"contact@abeall.com"},"_npmVersion":"10.8.2","description":"2D math utilities library","directories":{},"_nodeVersion":"20.18.0","dependencies":{"lit-html":"^2.7.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.6.2","parcel":"^2.9.3","ts-jest":"^29.1.1","typescript":"^5.1.6","@types/jest":"^29.5.3"},"_npmOperationalInternal":{"tmp":"tmp/2d-math-utils_1.0.1_1744994157839_0.04815153863464339","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"2d-math-utils","version":"1.0.2","description":"2D math utilities library","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","test:watch":"jest --watch","start:demo":"parcel serve demo/index.html --dist-dir .parcel-cache/demo","build:demo":"parcel build demo/index.html --dist-dir docs --public-url ./","prepublishOnly":"npm run build"},"keywords":["math","2d","geometry"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/aaronbeall/2d-math-utils.git"},"homepage":"https://aaronbeall.github.io/2d-math-utils/","devDependencies":{"@types/jest":"^29.5.3","jest":"^29.6.2","parcel":"^2.9.3","ts-jest":"^29.1.1","typescript":"^5.1.6"},"dependencies":{"lit-html":"^2.7.5"},"targets":{"module":false,"main":false,"types":false},"_id":"2d-math-utils@1.0.2","gitHead":"f39c10a317e518ebcc87355ae38a261056c4024f","bugs":{"url":"https://github.com/aaronbeall/2d-math-utils/issues"},"_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-albKfQMZ6na0kttwozxPFkPi/Fz1Pt7PFQULYNrry0wnI1OsIscjAmZ70XfvFT8cF/Ee10Khn8vfSJP2gazkmw==","shasum":"8b00660e9f9c3a8f9722bab2448fa0dda52fa270","tarball":"https://registry.npmjs.org/2d-math-utils/-/2d-math-utils-1.0.2.tgz","fileCount":18,"unpackedSize":69125,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDvxzyWfB6TLw7eCVdSLindxzPJ6HFnvSYo7bg67RfzdgIhANJztEDKDtBDsEY8GdHlhwtQoTmry2woE3iMHDROY2jc"}]},"_npmUser":{"name":"abeall","email":"contact@abeall.com"},"directories":{},"maintainers":[{"name":"abeall","email":"contact@abeall.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/2d-math-utils_1.0.2_1744995629679_0.7798536688723252"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-18T16:10:36.003Z","modified":"2025-04-18T17:00:30.097Z","1.0.0":"2025-04-18T16:10:36.188Z","1.0.1":"2025-04-18T16:35:58.030Z","1.0.2":"2025-04-18T17:00:29.890Z"},"license":"MIT","keywords":["math","2d","geometry"],"description":"2D math utilities library","maintainers":[{"name":"abeall","email":"contact@abeall.com"}],"readme":"# 2D Math Utils\n\nCommon math utilities meant for working with 2D games and simulations. This library provides a collection of functions and classes to simplify working with 2D geometry, physics, and vector math.\n\n[Live Demo](https://aaronbeall.github.io/2d-math-utils/)\n\n## Installation\n\nInstall the library using npm:\n\n```bash\nnpm install 2d-math-utils\n```\n\n## Example Usage\n\nHere's an example of how to use the library to calculate the angle between two points and create a vector:\n\n```typescript\nimport { angle, vector, point } from '2d-math-utils';\n\nconst pointA = { x: 0, y: 0 };\nconst pointB = { x: 3, y: 4 };\n\n// Calculate the angle between two points\nconst angleBetween = angle.radiansBetweenPoints(pointA, pointB);\nconsole.log(`Angle between points: ${angleBetween} radians`);\n\n// Create a vector from the angle\nconst directionVector = vector.fromAngleRadians(angleBetween, 5);\nconsole.log('Direction vector:', directionVector);\n\n// Add the vector to pointA to get a new point\nconst newPoint = point.add(pointA, directionVector);\nconsole.log('New point:', newPoint);\n```\n\n### TypeScript\n\nThis library is written in TypeScript, providing type definitions out of the box. \n\n```typescript\nimport { Point, Vector2d, Line, Circle, Rect } from '2d-math-utils';\n\nconst pointA: Point = { x: 0, y: 0 };\nconst pointB: Point = { x: 3, y: 4 };\n```\n\n### Alternative Import\n\nYou can also import specific modules directly if you prefer:\n\n```typescript\nimport * as vector from \"math-utils-2d/vector\";\n```\n\n## Package Overview\n\n### `angle`\nUtilities for working with angles, including conversions between degrees and radians, and calculating angles between points.\n\n### `vector`\nFunctions for creating and manipulating 2D vectors, such as addition, scaling, and rotation.\n\n### `point`\nUtilities for working with 2D points, including distance calculations and point transformations.\n\n### `physics` 🧪\n**_Experimental_**: Higher level physics-related utilities, including collision detection and basic physics simulations.\n\n### `PhysicalBody`\nA class representing a physical body with properties like position, velocity, and mass, useful for simulations. \n\n### `intersection`\nFunctions for calculating intersections between geometric shapes, such as lines and circles.","readmeFilename":"README.md","homepage":"https://aaronbeall.github.io/2d-math-utils/","repository":{"type":"git","url":"git+https://github.com/aaronbeall/2d-math-utils.git"},"bugs":{"url":"https://github.com/aaronbeall/2d-math-utils/issues"}}