{"id":20778126,"url":"https://github.com/stackgl/gl-vec3","last_synced_at":"2025-04-07T09:18:39.620Z","repository":{"id":23334383,"uuid":"26694768","full_name":"stackgl/gl-vec3","owner":"stackgl","description":"gl-matrix's vec3, split into smaller pieces","archived":false,"fork":false,"pushed_at":"2021-05-27T22:26:50.000Z","size":30,"stargazers_count":53,"open_issues_count":2,"forks_count":9,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-31T07:06:57.998Z","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":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-15T21:35:25.000Z","updated_at":"2024-03-01T19:23:26.000Z","dependencies_parsed_at":"2022-07-13T23:50:30.224Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-vec3","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-vec3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-vec3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-vec3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-vec3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-vec3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622983,"owners_count":20968575,"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-17T13:19:23.353Z","updated_at":"2025-04-07T09:18:39.602Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-vec3\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nPart of a fork of [@toji](http://github.com/toji)'s\n[gl-matrix](http://github.com/toji/gl-matrix) split into smaller pieces: this\npackage contains `glMatrix.vec3`.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-vec3.png)](https://nodei.co/npm/gl-vec3/)\n\n### `vec3 = require('gl-vec3')`\n\nWill load all of the module's functionality and expose it on a single\nobject. Note that any of the methods may also be required directly\nfrom their files.\n\nFor example, the following are equivalent:\n\n``` javascript\nvar scale = require('gl-vec3').scale\nvar scale = require('gl-vec3/scale')\n```\n\n## API\n\n  - [add()](#addoutvec3-avec3-bvec3)\n  - [angle()](#angleavec3-bvec3)\n  - [clone()](#cloneavec3)\n  - [ceil()](#ceiloutvec3-avec3)\n  - [copy()](#copyoutvec3-avec3)\n  - [create()](#create)\n  - [cross()](#crossoutvec3-avec3-bvec3)\n  - [distance()](#distanceavec3-bvec3)\n  - [dist()](#distanceavec3-bvec3)\n  - [divide()](#divideoutvec3-avec3-bvec3)\n  - [div()](#divideoutvec3-avec3-bvec3)\n  - [dot()](#dotavec3-bvec3)\n  - [equals()](#equalsavec3-bvec3)\n  - [exactEquals()](#exactequalsavec3-bvec3)\n  - [floor()](#flooroutvec3-avec3)\n  - [forEach()](#foreachaarray-stridenumber-offsetnumber-countnumber-fnfunction-argobject)\n  - [fromValues()](#fromvaluesxnumber-ynumber-znumber)\n  - [inverse()](#inverseoutvec3-avec3)\n  - [length()](#lengthavec3)\n  - [len()](#lengthavec3)\n  - [lerp()](#lerpoutvec3-avec3-bvec3-tnumber)\n  - [max()](#maxoutvec3-avec3-bvec3)\n  - [min()](#minoutvec3-avec3-bvec3)\n  - [multiply()](#multiplyoutvec3-avec3-bvec3)\n  - [mul()](#multiplyoutvec3-avec3-bvec3)\n  - [negate()](#negateoutvec3-avec3)\n  - [normalize()](#normalizeoutvec3-avec3)\n  - [random()](#randomoutvec3-scalenumber)\n  - [rotateX()](#rotatexoutvec3-avec3-bvec3-cnumber)\n  - [rotateY()](#rotateyoutvec3-avec3-bvec3-cnumber)\n  - [rotateZ()](#rotatezoutvec3-avec3-bvec3-cnumber)\n  - [round()](#roundoutvec3-avec3)\n  - [scale()](#scaleoutvec3-avec3-bnumber)\n  - [scaleAndAdd()](#scaleandaddoutvec3-avec3-bvec3-scalenumber)\n  - [set()](#setoutvec3-xnumber-ynumber-znumber)\n  - [squaredDistance()](#squareddistanceavec3-bvec3)\n  - [sqrDist()](#squareddistanceavec3-bvec3)\n  - [squaredLength()](#squaredlengthavec3)\n  - [sqrLen()](#squaredlengthavec3)\n  - [subtract()](#subtractoutvec3-avec3-bvec3)\n  - [sub()](#subtractoutvec3-avec3-bvec3)\n  - [transformMat3()](#transformmat3outvec3-avec3-mmat3)\n  - [transformMat4()](#transformmat4outvec3-avec3-mmat4)\n  - [transformQuat()](#transformquatoutvec3-avec3-qquat)\n\n## add(out:vec3, a:vec3, b:vec3)\n\n  Adds two vec3's\n\n## angle(a:vec3, b:vec3)\n\n  Get the angle between two 3D vectors\n\n## ceil(out:vec3, a:vec3)\n\n  `Math.ceil` the components of a vec3\n\n## clone(a:vec3)\n\n  Creates a new vec3 initialized with values from an existing vector\n\n## copy(out:vec3, a:vec3)\n\n  Copy the values from one vec3 to another\n\n## create()\n\n  Creates a new, empty vec3\n\n## cross(out:vec3, a:vec3, b:vec3)\n\n  Computes the cross product of two vec3's\n\n## distance(a:vec3, b:vec3)\n\n  Calculates the euclidian distance between two vec3's. Aliased as `dist`\n\n## divide(out:vec3, a:vec3, b:vec3)\n\n  Divides two vec3's. Aliased as `div`\n\n## dot(a:vec3, b:vec3)\n\n  Calculates the dot product of two vec3's\n\n## equals(a:vec3, b:vec3)\n\n  Returns whether or not the vectors have approximately the same elements in the same position.\n\n## exactEquals(a:vec3, b:vec3)\n\n  Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n\n## floor(out:vec3, a:vec3)\n\n  `Math.floor` the components of a vec3\n\n## forEach(a:Array, stride:Number, offset:Number, count:Number, fn:Function, [arg]:Object)\n\n  Perform some operation over an array of vec3s.\n\n## fromValues(x:Number, y:Number, z:Number)\n\n  Creates a new vec3 initialized with the given values\n\n## inverse(out:vec3, a:vec3)\n\n  Returns the inverse of the components of a vec3\n\n## length(a:vec3)\n\n  Calculates the length of a vec3. Aliased as `len`\n\n## lerp(out:vec3, a:vec3, b:vec3, t:Number)\n\n  Performs a linear interpolation between two vec3's\n\n## max(out:vec3, a:vec3, b:vec3)\n\n  Returns the maximum of two vec3's\n\n## min(out:vec3, a:vec3, b:vec3)\n\n  Returns the minimum of two vec3's\n\n## multiply(out:vec3, a:vec3, b:vec3)\n\n  Multiplies two vec3's. Aliased as `mul`\n\n## negate(out:vec3, a:vec3)\n\n  Negates the components of a vec3\n\n## normalize(out:vec3, a:vec3)\n\n  Normalize a vec3\n\n## random(out:vec3, [scale]:Number)\n\n  Generates a random vector with the given scale\n\n## rotateX(out:vec3, a:vec3, b:vec3, c:Number)\n\n  Rotate a 3D vector around the x-axis\n\n## rotateY(out:vec3, a:vec3, b:vec3, c:Number)\n\n  Rotate a 3D vector around the y-axis\n\n## rotateZ(out:vec3, a:vec3, b:vec3, c:Number)\n\n  Rotate a 3D vector around the z-axis\n\n## round(out:vec3, a:vec3)\n\n  `Math.round` the components of a vec3\n\n## scale(out:vec3, a:vec3, b:Number)\n\n  Scales a vec3 by a scalar number\n\n## scaleAndAdd(out:vec3, a:vec3, b:vec3, scale:Number)\n\n  Adds two vec3's after scaling the second operand by a scalar value\n\n## set(out:vec3, x:Number, y:Number, z:Number)\n\n  Set the components of a vec3 to the given values\n\n## squaredDistance(a:vec3, b:vec3)\n\n  Calculates the squared euclidian distance between two vec3's. Aliased as `sqrDist`\n\n## squaredLength(a:vec3)\n\n  Calculates the squared length of a vec3. Aliased as `sqrLen`\n\n## subtract(out:vec3, a:vec3, b:vec3)\n\n  Subtracts vector b from vector a. Aliased as `sub`\n\n## transformMat3(out:vec3, a:vec3, m:mat3)\n\n  Transforms the vec3 with a mat3.\n\n## transformMat4(out:vec3, a:vec3, m:mat4)\n\n  Transforms the vec3 with a mat4.\n  4th vector component is implicitly '1'\n\n## transformQuat(out:vec3, a:vec3, q:quat)\n\n  Transforms the vec3 with a quat\n\n## License\n\n[zlib](http://en.wikipedia.org/wiki/Zlib_License). See [LICENSE.md](https://github.com/stackgl/gl-vec3/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-vec3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-vec3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-vec3/lists"}