{"_id":"gl-vec2","_rev":"392505","name":"gl-vec2","description":"gl-matrix's vec2, split into smaller pieces","dist-tags":{"latest":"1.3.0"},"maintainers":[{"name":"alvinsight","email":"alvin.ourrad@bbc.co.uk"},{"name":"chrisdickinson","email":""},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"time":{"modified":"2021-08-04T03:59:09.000Z","created":"2014-11-15T21:52:21.117Z","1.3.0":"2018-08-24T16:37:58.612Z","1.2.0":"2018-02-05T21:04:57.688Z","1.1.0":"2018-02-05T21:03:16.350Z","1.0.0":"2014-11-15T21:52:21.117Z"},"users":{"joakin":true},"repository":{"type":"git","url":"git://github.com/stackgl/gl-vec2.git"},"versions":{"1.3.0":{"name":"gl-vec2","version":"1.3.0","description":"gl-matrix's vec2, split into smaller pieces","main":"index.js","license":{"type":"zlib","url":"http://github.com/stackgl/gl-vec2/blob/master/LICENSE.md"},"contributors":[{"name":"Brandon Jones","email":"tojiro@gmail.com"},{"name":"Colin MacKenzie IV","email":"sinisterchipmunk@gmail.com"}],"dependencies":{},"devDependencies":{"dox":"git://github.com/hughsk/dox.git#api-context","tape":"^4.8.0"},"scripts":{"get-docs":"cat *.js | dox --api","test":"node test/index.js"},"keywords":["gl-matrix","matrix","math","gl","vec2","vec","2d","vector","maths"],"repository":{"type":"git","url":"git://github.com/stackgl/gl-vec2.git"},"homepage":"https://github.com/stackgl/gl-vec2","bugs":{"url":"https://github.com/stackgl/gl-vec2/issues"},"gitHead":"a139f9eddbb1b8de7b1d3294d7a9b203e549e724","_id":"gl-vec2@1.3.0","_npmVersion":"6.3.0","_nodeVersion":"8.9.1","_npmUser":{"name":"rreusser","email":"rsreusser@gmail.com"},"dist":{"shasum":"83d472ed46034de8e09cbc857123fb6c81c51199","size":6528,"noattachment":false,"key":"/gl-vec2/-/gl-vec2-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gl-vec2/download/gl-vec2-1.3.0.tgz"},"maintainers":[{"name":"alvinsight","email":"alvin.ourrad@bbc.co.uk"},{"name":"chrisdickinson","email":""},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gl-vec2_1.3.0_1535128678527_0.4932332263650734"},"_hasShrinkwrap":false,"publish_time":1535128678612,"_cnpm_publish_time":1535128678612},"1.2.0":{"name":"gl-vec2","version":"1.2.0","description":"gl-matrix's vec2, split into smaller pieces","main":"index.js","license":{"type":"zlib","url":"http://github.com/stackgl/gl-vec2/blob/master/LICENSE.md"},"contributors":[{"name":"Brandon Jones","email":"tojiro@gmail.com"},{"name":"Colin MacKenzie IV","email":"sinisterchipmunk@gmail.com"}],"dependencies":{},"devDependencies":{"dox":"git://github.com/hughsk/dox.git#api-context","tape":"^4.8.0"},"scripts":{"get-docs":"cat *.js | dox --api","test":"node test/index.js"},"keywords":["gl-matrix","matrix","math","gl","vec2","vec","2d","vector","maths"],"repository":{"type":"git","url":"git://github.com/stackgl/gl-vec2.git"},"homepage":"https://github.com/stackgl/gl-vec2","bugs":{"url":"https://github.com/stackgl/gl-vec2/issues"},"gitHead":"ff94bacd9be375766f33aaf9c17cf6b983bf4ce3","_id":"gl-vec2@1.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"rreusser","email":"rsreusser@gmail.com"},"dist":{"shasum":"b0af95d2a582e3ad818446a1800093fc60b8b212","size":6344,"noattachment":false,"key":"/gl-vec2/-/gl-vec2-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gl-vec2/download/gl-vec2-1.2.0.tgz"},"maintainers":[{"name":"alvinsight","email":"alvin.ourrad@bbc.co.uk"},{"name":"chrisdickinson","email":""},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gl-vec2-1.2.0.tgz_1517864697534_0.5056531415320933"},"directories":{},"publish_time":1517864697688,"_hasShrinkwrap":false,"_cnpm_publish_time":1517864697688},"1.1.0":{"name":"gl-vec2","version":"1.1.0","description":"gl-matrix's vec2, split into smaller pieces","main":"index.js","license":{"type":"zlib","url":"http://github.com/stackgl/gl-vec2/blob/master/LICENSE.md"},"contributors":[{"name":"Brandon Jones","email":"tojiro@gmail.com"},{"name":"Colin MacKenzie IV","email":"sinisterchipmunk@gmail.com"}],"dependencies":{},"devDependencies":{"dox":"git://github.com/hughsk/dox.git#api-context","tape":"^4.8.0"},"scripts":{"get-docs":"cat *.js | dox --api","test":"node test/index.js"},"keywords":["gl-matrix","matrix","math","gl","vec2","vec","2d","vector","maths"],"repository":{"type":"git","url":"git://github.com/stackgl/gl-vec2.git"},"homepage":"https://github.com/stackgl/gl-vec2","bugs":{"url":"https://github.com/stackgl/gl-vec2/issues"},"gitHead":"a2e721c0ce5b47ec9c839493c092c90dd4cf08e9","_id":"gl-vec2@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"rreusser","email":"rsreusser@gmail.com"},"dist":{"shasum":"d70e5fb27a09cfe903e690345b0b40109432241f","size":6240,"noattachment":false,"key":"/gl-vec2/-/gl-vec2-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gl-vec2/download/gl-vec2-1.1.0.tgz"},"maintainers":[{"name":"alvinsight","email":"alvin.ourrad@bbc.co.uk"},{"name":"chrisdickinson","email":""},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gl-vec2-1.1.0.tgz_1517864595138_0.1054593431763351"},"directories":{},"publish_time":1517864596350,"_hasShrinkwrap":false,"_cnpm_publish_time":1517864596350},"1.0.0":{"name":"gl-vec2","version":"1.0.0","description":"gl-matrix's vec2, split into smaller pieces","main":"index.js","license":{"type":"zlib","url":"http://github.com/stackgl/gl-vec2/blob/master/LICENSE.md"},"contributors":[{"name":"Brandon Jones","email":"tojiro@gmail.com"},{"name":"Colin MacKenzie IV","email":"sinisterchipmunk@gmail.com"}],"dependencies":{},"devDependencies":{"dox":"git://github.com/hughsk/dox#api-context"},"scripts":{"get-docs":"cat *.js | dox --api"},"keywords":["gl-matrix","matrix","math","gl","vec2","vec","2d","vector","maths"],"repository":{"type":"git","url":"git://github.com/stackgl/gl-vec2.git"},"homepage":"https://github.com/stackgl/gl-vec2","bugs":{"url":"https://github.com/stackgl/gl-vec2/issues"},"gitHead":"21f460a371540258521fd2f720d80f14e87bd400","_id":"gl-vec2@1.0.0","_shasum":"77fce6ae9612856d6c8b621cd261cd8281b9c637","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"alvinsight","email":"alvin.ourrad@bbc.co.uk"},{"name":"chrisdickinson","email":""},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"dist":{"shasum":"77fce6ae9612856d6c8b621cd261cd8281b9c637","size":5112,"noattachment":false,"key":"/gl-vec2/-/gl-vec2-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gl-vec2/download/gl-vec2-1.0.0.tgz"},"directories":{},"publish_time":1416088341117,"_cnpm_publish_time":1416088341117,"_hasShrinkwrap":false}},"readme":"# gl-vec2\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.vec2`.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/gl-vec2.png)](https://nodei.co/npm/gl-vec2/)\n\n### `vec2 = require('gl-vec2')`\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-vec2').scale\nvar scale = require('gl-vec2/scale')\n```\n\n## API\n\n  - [add()](#addoutvec2-avec2-bvec2)\n  - [ceil()](#ceiloutvec2-avec2)\n  - [clone()](#cloneavec2)\n  - [copy()](#copyoutvec2-avec2)\n  - [create()](#create)\n  - [cross()](#crossoutvec3-avec2-bvec2)\n  - [distance()](#distanceavec2-bvec2)\n  - [dist()](#distanceavec2-bvec2)\n  - [divide()](#divideoutvec2-avec2-bvec2)\n  - [div()](#divideoutvec2-avec2-bvec2)\n  - [dot()](#dotavec2-bvec2)\n  - [equals()](#equalsavec2-bvec2)\n  - [exactEquals()](#exactequalsavec2-bvec2)\n  - [floor()](#flooroutvec2-avec2)\n  - [forEach()](#foreachaarray-stridenumber-offsetnumber-countnumber-fnfunction-argobject)\n  - [fromValues()](#fromvaluesxnumber-ynumber)\n  - [inverse()](#inverseoutvec2-avec2)\n  - [length()](#lengthavec2)\n  - [len()](#lengthavec2)\n  - [lerp()](#lerpoutvec2-avec2-bvec2-tnumber)\n  - [limit()](#limitoutvec2-avec2-maxnumber)\n  - [max()](#maxoutvec2-avec2-bvec2)\n  - [min()](#minoutvec2-avec2-bvec2)\n  - [multiply()](#multiplyoutvec2-avec2-bvec2)\n  - [mul()](#multiplyoutvec2-avec2-bvec2)\n  - [negate()](#negateoutvec2-avec2)\n  - [normalize()](#normalizeoutvec2-avec2)\n  - [random()](#randomoutvec2-scalenumber)\n  - [rotate()](#rotateoutvec2-avec2-anglenumber)\n  - [round()](#roundoutvec2-avec2)\n  - [scale()](#scaleoutvec2-avec2-bnumber)\n  - [scaleAndAdd()](#scaleandaddoutvec2-avec2-bvec2-scalenumber)\n  - [set()](#setoutvec2-xnumber-ynumber)\n  - [squaredDistance()](#squareddistanceavec2-bvec2)\n  - [sqrDist()](#squareddistanceavec2-bvec2)\n  - [squaredLength()](#squaredlengthavec2)\n  - [sqrLen()](#squaredlengthavec2)\n  - [subtract()](#subtractoutvec2-avec2-bvec2)\n  - [sub()](#subtractoutvec2-avec2-bvec2)\n  - [transformMat2()](#transformmat2outvec2-avec2-mmat2)\n  - [transformMat2d()](#transformmat2doutvec2-avec2-mmat2d)\n  - [transformMat3()](#transformmat3outvec2-avec2-mmat3)\n  - [transformMat4()](#transformmat4outvec2-avec2-mmat4)\n\n## add(out:vec2, a:vec2, b:vec2)\n\n  Adds two vec2's\n\n## ceil(out:vec2, a:vec2)\n\n  `Math.ceil` the components of a vec2\n\n## clone(a:vec2)\n\n  Creates a new vec2 initialized with values from an existing vector\n\n## copy(out:vec2, a:vec2)\n\n  Copy the values from one vec2 to another\n\n## create()\n\n  Creates a new, empty vec2\n\n## cross(out:vec3, a:vec2, b:vec2)\n\n  Computes the cross product of two vec2's\n  Note that the cross product must by definition produce a 3D vector\n\n## distance(a:vec2, b:vec2)\n\n  Calculates the euclidian distance between two vec2's. Aliased as `dist`.\n\n## divide(out:vec2, a:vec2, b:vec2)\n\n  Divides two vec2's. Aliased as `div`.\n\n## dot(a:vec2, b:vec2)\n\n  Calculates the dot product of two vec2's\n\n## equals(a:vec2, b:vec2)\n\n  Returns whether or not the vectors have approximately the same elements in the same position.\n\n## exactEquals(a:vec2, b:vec2)\n\n  Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n\n## floor(out:vec2, a:vec2)\n\n  `Math.floor` the components of a vec2\n\n## forEach(a:Array, stride:Number, offset:Number, count:Number, fn:Function, [arg]:Object)\n\n  Perform some operation over an array of vec2s.\n\n## fromValues(x:Number, y:Number)\n\n  Creates a new vec2 initialized with the given values\n\n## inverse(out:vec2, a:vec2)\n\n  Returns the inverse of the components of a vec2\n\n## length(a:vec2)\n\n  Calculates the length of a vec2. Aliased as `len`.\n\n## lerp(out:vec2, a:vec2, b:vec2, t:Number)\n\n  Performs a linear interpolation between two vec2's\n\n## limit(out:vec2, a:vec2, max:Number)\n\n  Limit the magnitude of this vector to the value used for the `max` parameter\n\n## max(out:vec2, a:vec2, b:vec2)\n\n  Returns the maximum of two vec2's\n\n## min(out:vec2, a:vec2, b:vec2)\n\n  Returns the minimum of two vec2's\n\n## multiply(out:vec2, a:vec2, b:vec2)\n\n  Multiplies two vec2's. Aliased as `mul`.\n\n## negate(out:vec2, a:vec2)\n\n  Negates the components of a vec2\n\n## normalize(out:vec2, a:vec2)\n\n  Normalize a vec2\n\n## random(out:vec2, [scale]:Number)\n\n  Generates a random vector with the given scale\n\n## round(out:vec2, a:vec2)\n\n  `Math.round` the components of a vec2\n\n## rotate(out:vec2, a:vec2, angle:Number)\n\n  Rotates a vec2 by an angle (in radians)\n\n## scale(out:vec2, a:vec2, b:Number)\n\n  Scales a vec2 by a scalar number\n\n## scaleAndAdd(out:vec2, a:vec2, b:vec2, scale:Number)\n\n  Adds two vec2's after scaling the second operand by a scalar value\n\n## set(out:vec2, x:Number, y:Number)\n\n  Set the components of a vec2 to the given values\n\n## squaredDistance(a:vec2, b:vec2)\n\n  Calculates the squared euclidian distance between two vec2's. Aliased as `sqrDist`.\n\n## squaredLength(a:vec2)\n\n  Calculates the squared length of a vec2. Aliased as `sqrLen`.\n\n## subtract(out:vec2, a:vec2, b:vec2)\n\n  Subtracts vector b from vector a. Aliased as `sub`.\n\n## transformMat2(out:vec2, a:vec2, m:mat2)\n\n  Transforms the vec2 with a mat2\n\n## transformMat2d(out:vec2, a:vec2, m:mat2d)\n\n  Transforms the vec2 with a mat2d\n\n## transformMat3(out:vec2, a:vec2, m:mat3)\n\n  Transforms the vec2 with a mat3\n  3rd vector component is implicitly '1'\n\n## transformMat4(out:vec2, a:vec2, m:mat4)\n\n  Transforms the vec2 with a mat4\n  3rd vector component is implicitly '0'\n  4th vector component is implicitly '1'\n\n## License\n\n[zlib](http://en.wikipedia.org/wiki/Zlib_License). See [LICENSE.md](https://github.com/stackgl/gl-vec2/blob/master/LICENSE.md) for details.\n","_attachments":{},"homepage":"https://github.com/stackgl/gl-vec2","bugs":{"url":"https://github.com/stackgl/gl-vec2/issues"},"license":{"type":"zlib","url":"http://github.com/stackgl/gl-vec2/blob/master/LICENSE.md"}}