{"id":26045804,"url":"https://github.com/lloydevans/vec2-fn","last_synced_at":"2026-04-29T21:35:33.102Z","repository":{"id":124527797,"uuid":"366155397","full_name":"lloydevans/vec2-fn","owner":"lloydevans","description":"A type-safe set of functions for working with vec2-like objects and arrays.","archived":false,"fork":false,"pushed_at":"2021-07-24T13:25:13.000Z","size":1146,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-14T14:13:09.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/lloydevans.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-10T19:33:36.000Z","updated_at":"2021-07-24T13:25:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdbee2fd-7d24-425e-b086-98eb9cc67981","html_url":"https://github.com/lloydevans/vec2-fn","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lloydevans/vec2-fn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydevans%2Fvec2-fn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydevans%2Fvec2-fn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydevans%2Fvec2-fn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydevans%2Fvec2-fn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lloydevans","download_url":"https://codeload.github.com/lloydevans/vec2-fn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydevans%2Fvec2-fn/sbom","scorecard":{"id":595828,"data":{"date":"2025-08-11","repo":{"name":"github.com/lloydevans/vec2-fn","commit":"ecf16884ec504fe2918c2711c32ba8f8f8e39ee2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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":"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":"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":"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":"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":"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":"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 'main'"],"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"}},{"name":"Vulnerabilities","score":0,"reason":"43 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4","Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653","Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj","Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67","Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w","Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2","Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T23:07:53.955Z","repository_id":124527797,"created_at":"2025-08-20T23:07:53.955Z","updated_at":"2025-08-20T23:07:53.955Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32445542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"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":[],"created_at":"2025-03-07T20:48:14.040Z","updated_at":"2026-04-29T21:35:33.097Z","avatar_url":"https://github.com/lloydevans.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vec2-fn\n[\u003cimg src=\"https://lloydevans.github.io/vec2-fn/assets/badge-functions.svg\"\u003e](LINK)\n[\u003cimg src=\"https://lloydevans.github.io/vec2-fn/assets/badge-lines.svg\"\u003e](LINK)\n\n### What's this?\n\nThis is a small JS library containing some utility functions for working with vector 2 (like) objects an arrays. The functions are sometimes not pure in the sense that they will modify the vector you provide to them. This allows the reuse of vector object instances and compatibility between different vector class types.\n\n### Install\n\n```bash\nnpm i -S vec2-fn\n```\n\n### API Docs\n\nAPI docs can be found [here](https://lloydevans.github.io/vec2-fn/)\n\n### ES usage:\n\n```ts\n// Import star\nimport * as vec2 from \"vec2-fn\";\nvec2.equal({ x: 0, y: 0 }, vec2.ZERO);\n\n// Import named\nimport { equal, ZERO } from \"vec2-fn\";\nequal({ x: 0, y: 0 }, ZERO);\n```\n\n### Node usage:\n\n```js\n// Import all\nconst vec2 = require(\"vec2-fn\");\nvec2.equal({ x: 0, y: 0 }, vec2.ZERO);\n\n// Assign named\nconst { equal, ZERO } = require(\"vec2-fn\");\nequal({ x: 0, y: 0 }, ZERO);\n```\n\n### Static usage:\n\nOld school method\n\n```html\n\u003cscript src=\"./bin/vec2.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\tvec2.equal({ x: 0, y: 0 }, vec2.ZERO);\n\u003c/script\u003e\n```\n\nFor static usage, ambient type definitions can optionally be referenced here `node_modules/vec2-fn/bin/vec2.d.ts`.\n\n## Table of contents\n\n### Interfaces\n\n- [Vec2](https://github.com/lloydevans/vec2-fn/blob/main/docs/md/interfaces/vec2.md)\n\n### Type aliases\n\n- [Vec2Array](https://lloydevans.github.io/vec2-fn/modules.html#vec2array)\n- [Vec2Param](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)\n- [Vec2Readonly](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\n### Variables\n\n- [APPROX\\_THRESHOLD](https://lloydevans.github.io/vec2-fn/modules.html#approx_threshold)\n- [MINUS\\_ONE](https://lloydevans.github.io/vec2-fn/modules.html#minus_one)\n- [ONE](https://lloydevans.github.io/vec2-fn/modules.html#one)\n- [PRECISION](https://lloydevans.github.io/vec2-fn/modules.html#precision)\n- [VEC2\\_DOWN](https://lloydevans.github.io/vec2-fn/modules.html#vec2_down)\n- [VEC2\\_DOWN\\_LEFT](https://lloydevans.github.io/vec2-fn/modules.html#vec2_down_left)\n- [VEC2\\_DOWN\\_RIGHT](https://lloydevans.github.io/vec2-fn/modules.html#vec2_down_right)\n- [VEC2\\_LEFT](https://lloydevans.github.io/vec2-fn/modules.html#vec2_left)\n- [VEC2\\_RIGHT](https://lloydevans.github.io/vec2-fn/modules.html#vec2_right)\n- [VEC2\\_UP](https://lloydevans.github.io/vec2-fn/modules.html#vec2_up)\n- [VEC2\\_UP\\_LEFT](https://lloydevans.github.io/vec2-fn/modules.html#vec2_up_left)\n- [VEC2\\_UP\\_RIGHT](https://lloydevans.github.io/vec2-fn/modules.html#vec2_up_right)\n- [ZERO](https://lloydevans.github.io/vec2-fn/modules.html#zero)\n\n### Functions\n\n- [abs](https://lloydevans.github.io/vec2-fn/modules.html#abs)\n- [add](https://lloydevans.github.io/vec2-fn/modules.html#add)\n- [angleTo](https://lloydevans.github.io/vec2-fn/modules.html#angleto)\n- [approx](https://lloydevans.github.io/vec2-fn/modules.html#approx)\n- [ceil](https://lloydevans.github.io/vec2-fn/modules.html#ceil)\n- [clamp](https://lloydevans.github.io/vec2-fn/modules.html#clamp)\n- [copy](https://lloydevans.github.io/vec2-fn/modules.html#copy)\n- [distance](https://lloydevans.github.io/vec2-fn/modules.html#distance)\n- [distanceSq](https://lloydevans.github.io/vec2-fn/modules.html#distancesq)\n- [divide](https://lloydevans.github.io/vec2-fn/modules.html#divide)\n- [dot](https://lloydevans.github.io/vec2-fn/modules.html#dot)\n- [dotPerp](https://lloydevans.github.io/vec2-fn/modules.html#dotperp)\n- [equal](https://lloydevans.github.io/vec2-fn/modules.html#equal)\n- [floor](https://lloydevans.github.io/vec2-fn/modules.html#floor)\n- [isOne](https://lloydevans.github.io/vec2-fn/modules.html#isone)\n- [isVec2LikeArray](https://lloydevans.github.io/vec2-fn/modules.html#isvec2likearray)\n- [isVec2LikeObject](https://lloydevans.github.io/vec2-fn/modules.html#isvec2likeobject)\n- [isZero](https://lloydevans.github.io/vec2-fn/modules.html#iszero)\n- [length](https://lloydevans.github.io/vec2-fn/modules.html#length)\n- [lengthSq](https://lloydevans.github.io/vec2-fn/modules.html#lengthsq)\n- [lerp](https://lloydevans.github.io/vec2-fn/modules.html#lerp)\n- [max](https://lloydevans.github.io/vec2-fn/modules.html#max)\n- [min](https://lloydevans.github.io/vec2-fn/modules.html#min)\n- [multiply](https://lloydevans.github.io/vec2-fn/modules.html#multiply)\n- [negate](https://lloydevans.github.io/vec2-fn/modules.html#negate)\n- [normalize](https://lloydevans.github.io/vec2-fn/modules.html#normalize)\n- [rotate](https://lloydevans.github.io/vec2-fn/modules.html#rotate)\n- [round](https://lloydevans.github.io/vec2-fn/modules.html#round)\n- [subtract](https://lloydevans.github.io/vec2-fn/modules.html#subtract)\n- [toArray](https://lloydevans.github.io/vec2-fn/modules.html#toarray)\n- [toObject](https://lloydevans.github.io/vec2-fn/modules.html#toobject)\n- [zero](https://lloydevans.github.io/vec2-fn/modules.html#zero)\n\n## Type aliases\n\n### Vec2Array\n\nƬ **Vec2Array**\u003cT\\\u003e: T\n\nVec2-like array object.\n\n#### Type parameters\n\n| Name | Type | Default |\n| :------ | :------ | :------ |\n| `T` | *number*[] | [*number*, *number*] |\n\nDefined in: types/vec2-array.ts:2\n\n___\n\n### Vec2Param\n\nƬ **Vec2Param**: [*Vec2*](https://github.com/lloydevans/vec2-fn/blob/main/docs/md/interfaces/vec2.md) \\| [*Vec2Array*](https://lloydevans.github.io/vec2-fn/modules.html#vec2array)\n\nA Vec2 array or object.\n\nDefined in: types/vec2-param.ts:5\n\n___\n\n### Vec2Readonly\n\nƬ **Vec2Readonly**: *Readonly*\u003c[*Vec2*](https://github.com/lloydevans/vec2-fn/blob/main/docs/md/interfaces/vec2.md)\\\u003e\n\nReadonly Vec2\n\nDefined in: types/vec2-readonly.ts:4\n\n## Variables\n\n### APPROX\\_THRESHOLD\n\n• `Const` **APPROX\\_THRESHOLD**: ``1e-8``= 0.00000001\n\nApproximate threshold for approx comparison\n\nDefined in: constants/approx-threshold.ts:2\n\n___\n\n### MINUS\\_ONE\n\n• `Const` **MINUS\\_ONE**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nConstant readonly Vec2 with both values equalling `-1`\n\nDefined in: constants/minus-one.ts:4\n\n___\n\n### ONE\n\n• `Const` **ONE**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nConstant readonly Vec2 with both values equalling `1`\n\nDefined in: constants/one.ts:4\n\n___\n\n### PRECISION\n\n• `Const` **PRECISION**: ``11``= 11\n\nThe number of decimal places calculations are made to.\n\nDefined in: constants/precision.ts:2\n\n___\n\n### VEC2\\_DOWN\n\n• `Const` **VEC2\\_DOWN**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing down\n\nDefined in: constants/vec2-down.ts:4\n\n___\n\n### VEC2\\_DOWN\\_LEFT\n\n• `Const` **VEC2\\_DOWN\\_LEFT**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing down-left\n\nDefined in: constants/vec2-down-left.ts:5\n\n___\n\n### VEC2\\_DOWN\\_RIGHT\n\n• `Const` **VEC2\\_DOWN\\_RIGHT**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing down-right\n\nDefined in: constants/vec2-down-right.ts:5\n\n___\n\n### VEC2\\_LEFT\n\n• `Const` **VEC2\\_LEFT**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing left\n\nDefined in: constants/vec2-left.ts:4\n\n___\n\n### VEC2\\_RIGHT\n\n• `Const` **VEC2\\_RIGHT**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing right\n\nDefined in: constants/vec2-right.ts:4\n\n___\n\n### VEC2\\_UP\n\n• `Const` **VEC2\\_UP**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing up\n\nDefined in: constants/vec2-up.ts:4\n\n___\n\n### VEC2\\_UP\\_LEFT\n\n• `Const` **VEC2\\_UP\\_LEFT**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing up-left\n\nDefined in: constants/vec2-up-left.ts:5\n\n___\n\n### VEC2\\_UP\\_RIGHT\n\n• `Const` **VEC2\\_UP\\_RIGHT**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nNormalized Vec2 pointing up-right\n\nDefined in: constants/vec2-up-right.ts:5\n\n___\n\n### ZERO\n\n• `Const` **ZERO**: [*Vec2Readonly*](https://lloydevans.github.io/vec2-fn/modules.html#vec2readonly)\n\nConstant readonly Vec2 with both values equalling `0`\n\nDefined in: constants/zero.ts:4\n\n## Functions\n\n### abs\n\n▸ **abs**\u003cT\\\u003e(`target`: T): T\n\nCalculate vec2 absolute value.\n\n**`example`**\n\n```ts\nabs({ x: -1, y: -1 }); // -\u003e { x: 0, y: 0 }\n```\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | Target vector. |\n\n**Returns:** T\n\n- A reference to the modified target vector.\n\nDefined in: fn/abs.ts:19\n\n▸ **abs**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `dest?`: D): D\n\nCalculate vec2 absolute value.\n\n**`example`**\n\n```ts\nabs({ x: -1, y: -1 }); // -\u003e { x: 0, y: 0 }\n```\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target vector. |\n| `dest?` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination object.\n\nDefined in: fn/abs.ts:34\n\n___\n\n### add\n\n▸ **add**\u003cT\\\u003e(`target`: T, `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*): T\n\nAdd vectors together.\n\n**`example`**\n\n```ts\nadd({ x: -1, y: -1 }, { x: 1, y: 1 }); // -\u003e { x: 0, y: 0 }\n```\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | Target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to add. |\n\n**Returns:** T\n\n- A reference to the modified target object.\n\nDefined in: fn/add.ts:17\n\n▸ **add**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*, `dest`: D): D\n\nAdd vectors together.\n\n**`example`**\n\n```ts\nlet result = { x: 0, y: 0 };\n\nadd({ x: -1, y: -1 }, { x: 1, y: 1 }, result); // -\u003e { x: 0, y: 0 }\n```\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to add. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination object.\n\nDefined in: fn/add.ts:34\n\n___\n\n### angleTo\n\n▸ **angleTo**(`to`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `from?`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *number*\n\nCalculate angle.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `to` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Vector to calculate to. |\n| `from` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Vector to calculate from. Defaults to `ZERO`. |\n\n**Returns:** *number*\n\n- Number angle result.\n\nDefined in: fn/angle-to.ts:14\n\n___\n\n### approx\n\n▸ **approx**(`v1`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `v2`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `threshold?`: *number*): *boolean*\n\nCalculate whether two vectors are approximately equal.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `v1` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | First vector for comparison. |\n| `v2` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Second vector for comparison. |\n| `threshold` | *number* | - |\n\n**Returns:** *boolean*\n\n- Whether the vectors are approximately equal or not.\n\nDefined in: fn/approx.ts:15\n\n___\n\n### ceil\n\n▸ **ceil**\u003cT\\\u003e(`target`: T): T\n\nCeil the values of a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | The target vector. |\n\n**Returns:** T\n\n- A reference to the modified target vector.\n\nDefined in: fn/ceil.ts:12\n\n▸ **ceil**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `dest`: D): D\n\nCeil the values of a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The target vector. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination vector.\n\nDefined in: fn/ceil.ts:20\n\n___\n\n### clamp\n\n▸ **clamp**\u003cT\\\u003e(`target`: T, `vMin`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*, `vMax`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*): T\n\nClamp a vector by min and max limits.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | Target object. |\n| `vMin` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | Minimum vector. |\n| `vMax` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | Maximum vector. |\n\n**Returns:** T\n\n- A reference to the modified target object.\n\nDefined in: fn/clamp.ts:14\n\n▸ **clamp**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `vMin`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*, `vMax`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*, `dest`: D): D\n\nClamp a vector by min and max limits.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target object. |\n| `vMin` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | Minimum vector. |\n| `vMax` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | Maximum vector. |\n| `dest` | D | Destination object to store the values. |\n\n**Returns:** D\n\n- A reference to the modified destination object.\n\nDefined in: fn/clamp.ts:24\n\n___\n\n### copy\n\n▸ **copy**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `dest`: D): D\n\nCopy one vectors values to another.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target to be copied from. |\n| `dest` | D | The destination object. |\n\n**Returns:** D\n\n- The destination object reference.\n\nDefined in: fn/copy.ts:13\n\n___\n\n### distance\n\n▸ **distance**(`from`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `to`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *number*\n\nGet the distance between two vectors.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `from` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | From vector. |\n| `to` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | To vector. |\n\n**Returns:** *number*\n\n- Number distance result.\n\nDefined in: fn/distance.ts:11\n\n___\n\n### distanceSq\n\n▸ **distanceSq**(`from`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `to`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *number*\n\nGet the squared distance between two vectors.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `from` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | From vector. |\n| `to` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | To vector. |\n\n**Returns:** *number*\n\n- Number distance squared result.\n\nDefined in: fn/distance-sq.ts:13\n\n___\n\n### divide\n\n▸ **divide**\u003cT\\\u003e(`target`: T, `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*): T\n\nDivide two vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | Target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to divide by. |\n\n**Returns:** T\n\n- A reference to the modified target object.\n\nDefined in: fn/divide.ts:11\n\n▸ **divide**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*, `dest`: D): D\n\nDivide two vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to divide by. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination object.\n\nDefined in: fn/divide.ts:20\n\n___\n\n### dot\n\n▸ **dot**(`v1`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `v2`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *number*\n\nCalculate the dot product of two vectors.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `v1` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Vector 1. |\n| `v2` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | = Vector 2. |\n\n**Returns:** *number*\n\n- Number result of the dot product.\n\nDefined in: fn/dot.ts:13\n\n___\n\n### dotPerp\n\n▸ **dotPerp**(`v1`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `v2`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *number*\n\nCalculate the perpendicular dot product of two vectors.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `v1` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Vector 1. |\n| `v2` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | = Vector 2. |\n\n**Returns:** *number*\n\n- Number result of the perpendicular dot product.\n\nDefined in: fn/dot-perp.ts:13\n\n___\n\n### equal\n\n▸ **equal**(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*): *boolean*\n\nCheck whether two vectors are exactly equal to system precision.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | Value vector. |\n\n**Returns:** *boolean*\n\n- Boolean result of whether the vectors are equal.\n\nDefined in: fn/equal.ts:13\n\n___\n\n### floor\n\n▸ **floor**\u003cT\\\u003e(`target`: T): T\n\nFloor the values of a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | The target vector. |\n\n**Returns:** T\n\n- A reference to the modified target vector.\n\nDefined in: fn/floor.ts:12\n\n▸ **floor**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `dest`: D): D\n\nFloor the values of a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The target vector. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination vector.\n\nDefined in: fn/floor.ts:20\n\n___\n\n### isOne\n\n▸ **isOne**(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *boolean*\n\nCheck whether a vector is exactly equal to one (1,1).\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target vector. |\n\n**Returns:** *boolean*\n\n- Boolean result of whether the vector is equal to one.\n\nDefined in: fn/is-one.ts:11\n\n___\n\n### isVec2LikeArray\n\n▸ **isVec2LikeArray**\u003cT\\\u003e(`value`: T): value is T extends [number, number] ? T : never\n\nCheck whether a value is a vec2-like array.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | *unknown* |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `value` | T | Input value to check. |\n\n**Returns:** value is T extends [number, number] ? T : never\n\n- Boolean result of whether the input is a vec2-like array.\n\nDefined in: fn/is-vec2-array.ts:9\n\n___\n\n### isVec2LikeObject\n\n▸ **isVec2LikeObject**\u003cT\\\u003e(`value`: T): value is T extends Vec2 ? T : never\n\nCheck whether a value is a vec2-like object.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | *unknown* |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `value` | T | Input value to check. |\n\n**Returns:** value is T extends Vec2 ? T : never\n\n- Boolean result of whether the input is a vec2-like object.\n\nDefined in: fn/is-vec2-object.ts:12\n\n___\n\n### isZero\n\n▸ **isZero**(`vec1`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *boolean*\n\nCheck whether a vector is exactly equal to zero (0,0).\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `vec1` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n**Returns:** *boolean*\n\n- Boolean result of whether the vector is equal to zero.\n\nDefined in: fn/is-zero.ts:11\n\n___\n\n### length\n\n▸ **length**(`vec`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *number*\n\nGet the length of a vector.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `vec` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The input vector. |\n\n**Returns:** *number*\n\n- The number result of the vector length.\n\nDefined in: fn/length.ts:10\n\n___\n\n### lengthSq\n\n▸ **lengthSq**(`vec`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param)): *number*\n\nGet the squared length of a vector.\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `vec` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The input vector. |\n\n**Returns:** *number*\n\n- The number result of the squared vector length.\n\nDefined in: fn/length-sq.ts:12\n\n___\n\n### lerp\n\n▸ **lerp**\u003cT, V\\\u003e(`target`: T, `value`: V, `k`: *number*): T\n\nLinear interpolate two vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n| `V` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | Vector A. |\n| `value` | V | Vector B. |\n| `k` | *number* | The amount to interpolate by. |\n\n**Returns:** T\n\n- A reference to the modified target object.\n\nDefined in: fn/lerp.ts:15\n\n▸ **lerp**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `k`: *number*, `dest`: D): D\n\nLinear interpolate two vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Vector A. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Vector B. |\n| `k` | *number* | The amount to interpolate by. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination object.\n\nDefined in: fn/lerp.ts:25\n\n___\n\n### max\n\n▸ **max**\u003cD\\\u003e(`dest`: D, ...`values`: ([*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*)[]): D\n\nReturns the max x and y of a set of vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `dest` | D | - |\n| `...values` | ([*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*)[] | - |\n\n**Returns:** D\n\n-\n\nDefined in: fn/max.ts:13\n\n___\n\n### min\n\n▸ **min**\u003cD\\\u003e(`dest`: D, ...`values`: ([*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*)[]): D\n\nReturns the min x and y of a set of vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `dest` | D | - |\n| `...values` | ([*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*)[] | - |\n\n**Returns:** D\n\n-\n\nDefined in: fn/min.ts:13\n\n___\n\n### multiply\n\n▸ **multiply**\u003cT\\\u003e(`target`: T, `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*): T\n\nMultiply two vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | The target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to multiply by. |\n\n**Returns:** T\n\n- A reference to the modified target object.\n\nDefined in: fn/multiply.ts:11\n\n▸ **multiply**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*, `dest`: D): D\n\nMultiply two vectors.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to multiply by. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination object.\n\nDefined in: fn/multiply.ts:20\n\n___\n\n### negate\n\n▸ **negate**\u003cT\\\u003e(`target`: T): T\n\nNegate a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | The target vector. |\n\n**Returns:** T\n\n- A reference to the modified target vector.\n\nDefined in: fn/negate.ts:12\n\n▸ **negate**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `dest`: D): D\n\nNegate a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The target vector. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination vector.\n\nDefined in: fn/negate.ts:20\n\n___\n\n### normalize\n\n▸ **normalize**\u003cT\\\u003e(`target`: T): T\n\nNormalize a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | Target can be vec object or array. |\n\n**Returns:** T\n\n- The modified target object.\n\nDefined in: fn/normalize.ts:13\n\n▸ **normalize**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `dest?`: D): D\n\nNormalize a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | Target can be vec object or array. |\n| `dest?` | D | destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the destination object.\n\nDefined in: fn/normalize.ts:21\n\n___\n\n### rotate\n\n▸ **rotate**\u003cT\\\u003e(`target`: T, `angle`: *number*): T\n\nRotate a vector around zero point.\n\n**`readonly`** - A reference to the modified target vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | The target vector. |\n| `angle` | *number* | The amount of rotation to apply in radians. |\n\n**Returns:** T\n\nDefined in: fn/rotate.ts:14\n\n▸ **rotate**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `angle`: *number*, `dest?`: D): D\n\nRotate a vector around zero point.\n\n**`readonly`** - A reference to the modified destination vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The target vector. |\n| `angle` | *number* | The amount of rotation to apply in radians. |\n| `dest?` | D | Optional destination object to store the result. |\n\n**Returns:** D\n\nDefined in: fn/rotate.ts:23\n\n___\n\n### round\n\n▸ **round**\u003cT\\\u003e(`target`: T): T\n\nRound the values of a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | The target vector. |\n\n**Returns:** T\n\n- A reference to the modified target vector.\n\nDefined in: fn/round.ts:12\n\n▸ **round**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `dest`: D): D\n\nRound the values of a vector.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The target vector. |\n| `dest` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination vector.\n\nDefined in: fn/round.ts:20\n\n___\n\n### subtract\n\n▸ **subtract**\u003cT\\\u003e(`target`: T, `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*): T\n\nSubtract one vector from another.\n\n**`example`**\n\n```ts\nsubtract({ x: 1, y: 1 }, { x: 1, y: 1 }); // -\u003e { x: 0, y: 0 }\n```\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | The target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to subtract. |\n\n**Returns:** T\n\n- A reference to the modified target vector.\n\nDefined in: fn/subtract.ts:17\n\n▸ **subtract**\u003cD\\\u003e(`target`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param), `value`: [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number*, `dest?`: D): D\n\nSubtract one vector from another.\n\n**`example`**\n\n```ts\nlet result = { x: 0, y: 0 };\nsubtract({ x: 1, y: 1 }, { x: 1, y: 1 }, result); // -\u003e { x: 0, y: 0 }\n```\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `D` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) | The target vector. |\n| `value` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) \\| *number* | The vector to subtract. |\n| `dest?` | D | Destination object to store the result. |\n\n**Returns:** D\n\n- A reference to the modified destination vector.\n\nDefined in: fn/subtract.ts:33\n\n___\n\n### toArray\n\n▸ **toArray**(`target`: [*Vec2*](https://github.com/lloydevans/vec2-fn/blob/main/docs/md/interfaces/vec2.md)): [*Vec2Array*](https://lloydevans.github.io/vec2-fn/modules.html#vec2array)\n\nConvert a vec2-like object to an array.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `target` | [*Vec2*](https://github.com/lloydevans/vec2-fn/blob/main/docs/md/interfaces/vec2.md) |\n\n**Returns:** [*Vec2Array*](https://lloydevans.github.io/vec2-fn/modules.html#vec2array)\n\n- Newly created array.\n\nDefined in: fn/to-array.ts:12\n\n___\n\n### toObject\n\n▸ **toObject**(`target`: [*Vec2Array*](https://lloydevans.github.io/vec2-fn/modules.html#vec2array)): [*Vec2*](https://github.com/lloydevans/vec2-fn/blob/main/docs/md/interfaces/vec2.md)\n\nConvert a vec2-like array to an object.\n\n#### Parameters\n\n| Name | Type |\n| :------ | :------ |\n| `target` | [*Vec2Array*](https://lloydevans.github.io/vec2-fn/modules.html#vec2array) |\n\n**Returns:** [*Vec2*](https://github.com/lloydevans/vec2-fn/blob/main/docs/md/interfaces/vec2.md)\n\n- Newly created Vec2 object.\n\nDefined in: fn/to-object.ts:12\n\n___\n\n### zero\n\n▸ **zero**\u003cT\\\u003e(`target`: T): T\n\nSet vector to zero.\n\n#### Type parameters\n\n| Name | Type |\n| :------ | :------ |\n| `T` | [*Vec2Param*](https://lloydevans.github.io/vec2-fn/modules.html#vec2param) |\n\n#### Parameters\n\n| Name | Type | Description |\n| :------ | :------ | :------ |\n| `target` | T | Target Vec2-like object the values will be written to. |\n\n**Returns:** T\n\n- A reference to the object the result was written to.\n\nDefined in: fn/zero.ts:12\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flloydevans%2Fvec2-fn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flloydevans%2Fvec2-fn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flloydevans%2Fvec2-fn/lists"}