{"id":19063434,"url":"https://github.com/nmuldavin/vector-methods","last_synced_at":"2026-06-25T07:31:13.830Z","repository":{"id":177498755,"uuid":"55565076","full_name":"nmuldavin/vector-methods","owner":"nmuldavin","description":"Vector methods to be added to JavaScript Arrays","archived":false,"fork":false,"pushed_at":"2016-04-07T18:51:16.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T13:30:02.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmuldavin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-04-06T00:58:46.000Z","updated_at":"2016-07-11T01:24:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e47a92a-9e1f-4c18-bdc4-6bf232ded2b7","html_url":"https://github.com/nmuldavin/vector-methods","commit_stats":null,"previous_names":["nmuldavin/vector-methods"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fvector-methods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fvector-methods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fvector-methods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmuldavin%2Fvector-methods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmuldavin","download_url":"https://codeload.github.com/nmuldavin/vector-methods/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240118332,"owners_count":19750470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-09T00:35:58.583Z","updated_at":"2026-05-14T10:30:18.676Z","avatar_url":"https://github.com/nmuldavin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vector-methods\n\nProvides a useful set of vector methods to be added to JavaScript Arrays. Unlike most JavaScript vector libraries, these methods\nmay be used for arrays of arbitrary dimension.\n\n## Use\n\nTo use, include `vector_methods.js` in your project. Vector methods can be added to any array or array-like object with `addVectorMethods()`. For example: \n\n```javascript\nvar arr = [1, 2, 3];\naddVectorMethods(arr);\narr.norm(); // 3.74\n```\nTo add method to all Arrays, use `addVectorMethods(Array.prototype)`. Vector methods do not conflict with any standard Array methods. If you do not want to mess with the built in Array prototype, `vector.js` provides a `Vector` psuedoclass which inherits all vector functionality and the added vector methods.\n\nVector methods includes all usual vector operations including the dot product, scalar multiplication, norm, distance to another vector, and cross product among others. You can also define your own element-wise operation between corresponding elements using `elementWise`:\n\n```javascript\nvar operation = function(a, b) {\n    return a*pow(a, 10*b);\n}\n\nv2.elementWise(operation, v2);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmuldavin%2Fvector-methods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmuldavin%2Fvector-methods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmuldavin%2Fvector-methods/lists"}