{"id":26886449,"url":"https://github.com/leodeslf/vec.js","last_synced_at":"2026-02-28T11:07:26.352Z","repository":{"id":57126756,"uuid":"158038246","full_name":"leodeslf/vec.js","owner":"leodeslf","description":"🚀 JavaScript vector library.","archived":false,"fork":false,"pushed_at":"2024-11-01T23:25:00.000Z","size":331,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-16T03:19:46.341Z","etag":null,"topics":["geometry","javascript","linear-algebra","math","vector"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@leodeslf/vec.js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leodeslf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-18T00:57:19.000Z","updated_at":"2024-11-01T23:25:04.000Z","dependencies_parsed_at":"2024-05-11T17:47:04.012Z","dependency_job_id":"8177aca7-ef4f-44fe-91ad-c97d604b94e3","html_url":"https://github.com/leodeslf/vec.js","commit_stats":{"total_commits":148,"total_committers":2,"mean_commits":74.0,"dds":"0.15540540540540537","last_synced_commit":"e38d4c50fd128932d228a9e4b2b69f3dff081d27"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leodeslf/vec.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodeslf%2Fvec.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodeslf%2Fvec.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodeslf%2Fvec.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodeslf%2Fvec.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leodeslf","download_url":"https://codeload.github.com/leodeslf/vec.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodeslf%2Fvec.js/sbom","scorecard":{"id":584586,"data":{"date":"2025-08-11","repo":{"name":"github.com/leodeslf/vec.js","commit":"8727e02a761893e43ca5b4fd8bd1c4deb540a004"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T20:06:37.278Z","repository_id":57126756,"created_at":"2025-08-20T20:06:37.278Z","updated_at":"2025-08-20T20:06:37.278Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29931352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geometry","javascript","linear-algebra","math","vector"],"created_at":"2025-03-31T19:18:52.767Z","updated_at":"2026-02-28T11:07:26.334Z","avatar_url":"https://github.com/leodeslf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vec.js\n\n![version](https://img.shields.io/npm/v/@leodeslf/vec.js?color=3af) ![license](https://img.shields.io/npm/l/@leodeslf/vec.js?color=3af)\n\n```txt\n\n            .                 .\n    \u003c--------\\               /--------\u003e\n      \u003c-------\\.           ./-------\u003e\n        \u003c------\\\\         //------\u003e\n          \u003c-----\\\\.     .//-----\u003e\n            \u003c----\\\\\\   ///----\u003e\n              \u003c---\\\\\\ ///---\u003e\n                \u003c--\\\\Y//--\u003e\n                  \u003c-\\|/-\u003e\n                     V\n\n```\n\n## Table of contents\n\n* [About](#about)\n* [Installation](#installation)\n* [CDNs](#cdns)\n* [Usage](#usage)\n  * [Properties](#properties)\n    * [Shortcuts](#shortcuts)\n    * [Alias](#alias)\n  * [Linear Algebra](#linear-algebra)\n  * [Copying \u0026 Creating](#copying--creating)\n  * [Boolean Conditions](#boolean-conditions)\n  * [Magnitude Manipulation](#magnitude-manipulation)\n  * [Miscellaneous](#miscellaneous)\n* [Author](#author)\n* [License](#license)\n\n## About\n\n\u003eJavaScript vector library.\n\nA set of classes that provide functionality related to basic **linear-algebra**, **geometry**, and more, for **2, 3, and 4-dimensional vectors**.\n\n## Installation\n\n```bash\nnpm i @leodeslf/vec.js\n```\n\n```bash\npnpm i @leodeslf/vec.js\n```\n\n```bash\nyarn add @leodeslf/vec.js\n```\n\n```bash\nbun i @leodeslf/vec.js\n```\n\n## CDNs\n\n```bash\nhttps://unpkg.com/@leodeslf/vec.js\n```\n\n```bash\nhttps://cdn.jsdelivr.net/npm/@leodeslf/vec.js\n```\n\n## Usage\n\nMost methods are available as both *instance* and `static` members. The ones that modify the current vector return `this`, thus we can *chain method calls*. Other than e.g.: `vector.x`, `vector.y`, and `vector.xy` (as an array), vectors are iterable, so it's possible to iterate trough their components using `for-of` or spread operator (e.g.: `...vector`).\n\n```javascript\n// E.g.:\nimport { Vec2 } from '@leodeslf/vec.js';\n\nconst position = new Vec2(1, 1.8);\nconst target = new Vec2(1, 10);\nconst distance = position.distance(target); // 8.2\nconst direction = Vec2.subtract(target, position).normalize(); // { x: 0, y: 1 }\n```\n\n### Properties\n\n|Name|`Vec2`|`Vec3`|`Vec4`|\n|:-|:-:|:-:|:-:|\n|`angleW`|||✓\\*|\n|`angleX`|✓|✓\\*|✓\\*|\n|`angleY`|✓|✓\\*|✓\\*|\n|`angleZ`||✓\\*|✓\\*|\n|`magnitude`|✓|✓|✓|\n|`magnitudeSq`\\*|✓|✓|✓|\n|`w`|||✓|\n|`x`|✓|✓|✓|\n|`y`|✓|✓|✓|\n|`z`||✓|✓|\n\n*Property is `readonly`.\n\n#### Shortcuts\n\nTo set/get components straight as/from arrays.\n\n|Name|`Vec2`|`Vec3`|`Vec4`|\n|:-|:-:|:-:|:-:|\n|`xy`|✓|||\n|`xyz`||✓||\n|`xyzw`|||✓|\n\n#### Alias\n\nFor 3D and 4D vector components and shortcuts.\n\n|(Name) Alias|`Vec3`|`Vec4`|\n|:-|:-:|:-:|\n|(`w`) `a`||✓|\n|(`x`) `r`|✓|✓|\n|(`y`) `g`|✓|✓|\n|(`z`) `b`|✓|✓|\n|(`xyz`) `rgb`|✓||\n|(`xyzw`) `rgba`||✓|\n\n### Linear Algebra\n\n|Name|`Vec2`|`Vec3`|`Vec4`|\n|:-|:-:|:-:|:-:|\n|`add`|✓|✓|✓|\n|`angleBetween`|✓|✓|✓|\n|`cross`||✓||\n|`distance`|✓|✓|✓|\n|`distanceChebyshev`\\*|✓|✓|✓|\n|`distanceManhattan`\\*|✓|✓|✓|\n|`distanceMinkowski`\\*|✓|✓|✓|\n|`distanceSq`|✓|✓|✓|\n|`dot`|✓|✓|✓|\n|`immutable`\\*|✓|✓|✓|\n|`lerp`\\*|✓|✓|✓|\n|`negate`|✓|✓|✓|\n|`normalize`|✓|✓|✓|\n|`project`|✓|✓|✓|\n|`rotateX`||✓||\n|`rotateY`||✓||\n|`rotateZ`|✓|✓||\n|`scale`|✓|✓|✓|\n|`subtract`|✓|✓|✓|\n|`zero`|✓|✓|✓|\n\n*Static method only.\n\n### Copying \u0026 Creating\n\n|Name|`Vec2`|`Vec3`|`Vec4`|\n|:-|:-:|:-:|:-:|\n|`clone`|✓|✓|✓|\n|`copy`|✓|✓|✓|\n|`fromCylindricalCoords`\\*||✓||\n|`fromPolarCoords`\\*|✓|||\n|`fromSphericalCoords`\\*||✓||\n|`random`|✓|✓|✓|\n\n*Static method only.\n\n### Boolean Conditions\n\n|Name|`Vec2`|`Vec3`|`Vec4`|\n|:-|:-:|:-:|:-:|\n|`satisfyEquality`|✓|✓|✓|\n|`satisfyOpposition`|✓|✓|✓|\n|`isInfinite`|✓|✓|✓|\n|`isNaN`|✓|✓|✓|\n|`isZero`|✓|✓|✓|\n\n### Magnitude Manipulation\n\n|Name|`Vec2`|`Vec3`|`Vec4`|\n|:-|:-:|:-:|:-:|\n|`limitMax`|✓|✓|✓|\n|`limitMin`|✓|✓|✓|\n|`clamp`|✓|✓|✓|\n\n### Miscellaneous\n\n|Name|`Vec2`|`Vec3`|`Vec4`|\n|:-|:-:|:-:|:-:|\n|`lookAt`|✓|✓|✓|\n|`turnLeft`|✓|||\n|`turnRight`|✓|||\n\n## Author\n\nCopyright (c) [Leonardo de S. Leal F.](https://github.com/leodeslf \"GitHub profile\"), 2018-present.\n\n## License\n\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodeslf%2Fvec.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleodeslf%2Fvec.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodeslf%2Fvec.js/lists"}