{"_id":"@augustinmauroy/vec3","_rev":"3-6467a0dc1b8199caa7e390e0a1482c14","name":"@augustinmauroy/vec3","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@augustinmauroy/vec3","version":"1.0.0","author":{"name":"Augustin Mauroy"},"license":"MIT","_id":"@augustinmauroy/vec3@1.0.0","maintainers":[{"name":"augustinmauroy","email":"augustin.mauroy@outlook.fr"}],"homepage":"https://github.com/AugustinMauroy/vec3#readme","bugs":{"url":"https://github.com/AugustinMauroy/vec3/issues"},"dist":{"shasum":"27945b11e5c2c131641a300e008b872f17d72875","tarball":"https://registry.npmjs.org/@augustinmauroy/vec3/-/vec3-1.0.0.tgz","fileCount":9,"integrity":"sha512-AuN/LqGRW09lv1pX0oHEQ/2c9SzWOnSfOF6QmcGzlH8CnSAKI/8GY+hzQ1RpUKF7GGMw5qkVZoKiNXpc0Fpu0A==","signatures":[{"sig":"MEUCIQDOrAO4Nw/LcYcEcsdZXBognZHhwFgIhwZrtuEXcvfWyQIgT1e45zL+ZqaqpRjTGh2+mfYiguYqMEWcZgZBYNcb7NY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@augustinmauroy%2fvec3@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":43383},"main":"dist/mod.js","type":"module","types":"./dist/mod.d.ts","gitHead":"bf65fb6f985b25f55859dd6b1c71637508346a14","scripts":{"test":"node --test tests/**/*.test.ts","build":"tsc","biome:ci":"biome ci ./","biome:lint":"biome lint ./","pre-commit":"node --run biome:lint:fix; node --run biome:format:fix","types:check":"tsc --noEmit","biome:format":"biome format ./","test:coverage":"node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=./coverage.lcov --test-reporter=spec --test-reporter-destination=stdout tests/**/*.test.ts","biome:lint:fix":"biome lint --fix ./","biome:format:fix":"biome format --fix ./"},"_npmUser":{"name":"augustinmauroy","email":"augustin.mauroy@outlook.fr"},"repository":{"url":"git+https://github.com/AugustinMauroy/vec3.git","type":"git"},"_npmVersion":"10.9.2","description":"A small and efficient JavaScript library for 3D vector math. It provides a simple API for creating, manipulating, and performing operations on 3D vectors.","directories":{},"_nodeVersion":"23.11.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3","@types/node":"^22.15.3","@biomejs/biome":"^1.9.4"},"_npmOperationalInternal":{"tmp":"tmp/vec3_1.0.0_1746369960394_0.3952706580225711","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@augustinmauroy/vec3","version":"1.0.1","author":{"name":"Augustin Mauroy"},"license":"MIT","_id":"@augustinmauroy/vec3@1.0.1","maintainers":[{"name":"augustinmauroy","email":"augustin.mauroy@outlook.fr"}],"homepage":"https://github.com/AugustinMauroy/vec3#readme","bugs":{"url":"https://github.com/AugustinMauroy/vec3/issues"},"dist":{"shasum":"64b082e6e5a30a0eac92c6e440e69c105371deff","tarball":"https://registry.npmjs.org/@augustinmauroy/vec3/-/vec3-1.0.1.tgz","fileCount":9,"integrity":"sha512-72XaSgyThybe8v0rShCsOscryeJ1pwSeNjuWNPwXm4Z1/I5+C1kpsfOLZZPj85HdkCiknV9x5guiyS10RcC+xA==","signatures":[{"sig":"MEUCIGbMahbpk4rvCmMbu49SYvpHTW0NWxJZdXPgYDO3UD/WAiEAp0XV5oL6+/7uRn1AkmaERmEVPp8oOAjWiLrlk2fFH6c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@augustinmauroy%2fvec3@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46194},"main":"dist/mod.js","type":"module","types":"./dist/mod.d.ts","gitHead":"1d524638a2f67860fec8d3d525eff4217237a6c5","scripts":{"test":"node --test tests/**/*.test.ts","build":"tsc","biome:ci":"biome ci ./","biome:lint":"biome lint ./","pre-commit":"node --run biome:lint:fix; node --run biome:format:fix","types:check":"tsc --noEmit","biome:format":"biome format ./","test:coverage":"node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=./coverage.lcov --test-reporter=spec --test-reporter-destination=stdout --test-coverage-include='src/**/*' --test-coverage-exclude='**/*.test.ts' './**/*.test.ts'","biome:lint:fix":"biome lint --fix ./","biome:format:fix":"biome format --fix ./"},"_npmUser":{"name":"augustinmauroy","email":"augustin.mauroy@outlook.fr"},"repository":{"url":"git+https://github.com/AugustinMauroy/vec3.git","type":"git"},"_npmVersion":"10.9.2","description":"A small and efficient JavaScript library for 3D vector math. It provides a simple API for creating, manipulating, and performing operations on 3D vectors.","directories":{},"_nodeVersion":"23.11.1","_hasShrinkwrap":false,"devDependencies":{"bench-node":"^0.6.0","typescript":"^5.8.3","@types/node":"^22.15.3","@biomejs/biome":"^1.9.4"},"_npmOperationalInternal":{"tmp":"tmp/vec3_1.0.1_1748857209307_0.48744985310012345","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@augustinmauroy/vec3","description":"A small and efficient JavaScript library for 3D vector math. It provides a simple API for creating, manipulating, and performing operations on 3D vectors.","version":"1.1.0","type":"module","author":{"name":"Augustin Mauroy"},"license":"MIT","main":"dist/mod.js","scripts":{"biome:format:fix":"biome format --fix ./","biome:format":"biome format ./","biome:lint:fix":"biome lint --fix ./","biome:lint":"biome lint ./","biome:ci":"biome ci ./","build":"tsc","pre-commit":"node --run biome:lint:fix; node --run biome:format:fix","test":"node --test tests/**/*.test.ts","test:coverage":"node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=./coverage.lcov --test-reporter=spec --test-reporter-destination=stdout --test-coverage-include='src/**/*' --test-coverage-exclude='**/*.test.ts' './**/*.test.ts'","types:check":"tsc --noEmit"},"devDependencies":{"@biomejs/biome":"^1.9.4","@types/node":"^22.15.3","bench-node":"^0.6.0","typescript":"^5.8.3"},"repository":{"type":"git","url":"git+https://github.com/AugustinMauroy/vec3.git"},"_id":"@augustinmauroy/vec3@1.1.0","gitHead":"ac9322dec06cecfc62449b609fdbfe8261d60484","types":"./dist/mod.d.ts","bugs":{"url":"https://github.com/AugustinMauroy/vec3/issues"},"homepage":"https://github.com/AugustinMauroy/vec3#readme","_nodeVersion":"24.1.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-TRora79ucJkYmvZM3f7xSnrjiI/gcTx7LM3lz3+Nak1miFADmUkaQ3uJ9MdkewZa3pyYlc58Yl4vbraFo7gMOQ==","shasum":"13c546dcb679c663a5f33109b4cc997180a4a72c","tarball":"https://registry.npmjs.org/@augustinmauroy/vec3/-/vec3-1.1.0.tgz","fileCount":9,"unpackedSize":47813,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@augustinmauroy%2fvec3@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC1oFxLskuRhoORMzj6it6kV9Y5yoDNx20h0bhtIg5f5QIgGBKet44mzkDBWIE85cm88X2aEYeWYLlV4d0t8A59xTI="}]},"_npmUser":{"name":"augustinmauroy","email":"augustin.mauroy@outlook.fr"},"directories":{},"maintainers":[{"name":"augustinmauroy","email":"augustin.mauroy@outlook.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vec3_1.1.0_1749198931844_0.35061806023781905"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-04T14:46:00.325Z","modified":"2025-06-06T08:35:32.459Z","1.0.0":"2025-05-04T14:46:00.601Z","1.0.1":"2025-06-02T09:40:09.545Z","1.1.0":"2025-06-06T08:35:32.075Z"},"bugs":{"url":"https://github.com/AugustinMauroy/vec3/issues"},"author":{"name":"Augustin Mauroy"},"license":"MIT","homepage":"https://github.com/AugustinMauroy/vec3#readme","repository":{"type":"git","url":"git+https://github.com/AugustinMauroy/vec3.git"},"description":"A small and efficient JavaScript library for 3D vector math. It provides a simple API for creating, manipulating, and performing operations on 3D vectors.","maintainers":[{"name":"augustinmauroy","email":"augustin.mauroy@outlook.fr"}],"readme":"# @augustinmauroy/vec3\n\nA small and efficient JavaScript library for 3D vector math. It provides a simple API for creating, manipulating, and performing operations on 3D vectors.\n\n[![npm version](https://img.shields.io/npm/v/@augustinmauroy/vec3.svg)](https://www.npmjs.com/package/@augustinmauroy/vec3)\n[![JSR](https://jsr.io/badges/@augustinmauroy/vec3)](https://jsr.io/@augustinmauroy/vec3)\n[![codecov](https://codecov.io/gh/AugustinMauroy/vec3/graph/badge.svg?token=UXAYBOEA8W)](https://codecov.io/gh/AugustinMauroy/vec3)\n\n> **NOTE** This package is tested with [Node.js](https://nodejs.org/en/) but the package din't use any Node.js specific feature. It should work in any JavaScript environment (browser, Deno, etc.). If you encounter any issue, please open an issue on [GitHub](https://github.com/AugustinMauroy/vec3/issues).\n\n## Example\n\n```typescript\nimport { Vec3, v } from '@augustinmauroy/vec3';\n\n// Create vectors using the constructor\nconst v1 = new Vec3(1, 2, 3);\nconst v2 = new Vec3(4, 5, 6);\n\n// Create vectors using the helper function\nconst v3 = v(7, 8, 9); // From numbers\nconst v4 = v([10, 11, 12]); // From an array\nconst v5 = v({ x: 13, y: 14, z: 15 }); // From an object\nconst v6 = v('(1, -1, 3.14)'); // From a string representation\n\n// Perform operations (most methods modify the vector in place)\nv1.add(v2); // v1 is now (5, 7, 9)\nconsole.log(v1.toString()); // Output: (5, 7, 9)\n\n// Use immutable operations (return a new Vec3 instance)\nconst sum = v3.plus(v4); // sum is (17, 19, 21), v3 remains unchanged\nconsole.log(sum.toString()); // Output: (17, 19, 21)\n\nconst scaled = v5.scaled(2); // scaled is (26, 28, 30), v5 remains unchanged\nconsole.log(scaled.toString()); // Output: (26, 28, 30)\n\n// Calculate distance\nconst distance = v1.distanceTo(v2);\nconsole.log(distance);\n\n// Normalize a vector\nconst normalized = v3.unit(); // normalized is a unit vector, v3 remains unchanged\nconsole.log(normalized.norm()); // Output: ~1\n```\n","readmeFilename":"README.md"}