wade.vec2.addInPlace (v1, v2)
Add two vectors and store the result in the first vector
wade.vec2.clamp (v, min, max)
Clamp a vector, that is force both its components to be between a minimum value and a maximum value
wade.vec2.clampInPlace (v, min, max)
Clamp a vector, that is force both its components to be between a minimum value and a maximum value. Unlike the 'clamp' function, this one modifies the original vector.
wade.vec2.divInPlace (v1, v2)
Divide a vector by another vector and store the result in the first vector
wade.vec2.equal (v1, v2, tolerance)
Check whether two vectors are equal (i.e. both x and y have the same values), optionally accounting for some tolerance in the comparisons
wade.vec2.lengthSquared (v)
Calculate the length squared of a vector
wade.vec2.maxComponent (v)
Get the larger value of the x and y components of a vector
wade.vec2.minComponent (v)
Get the smaller value of the x and y components of a vector
wade.vec2.mulInPlace (v1, v2)
Multiply two vectors and store the result in the first vector
wade.vec2.normalizeIfPossible (v)
Normalize a vector (so that its length is 1). Note that if the length of the vector is very close to 0, this operation will just return the original vector
wade.vec2.normalizeInPlace (v)
Normalize a vector (so that its length is 1). Note that if the length of the vector is very close to 0, this operation may fail and return a vector whose components are NaN. Unlike the 'normalize' function, this one modifies the original vector.
wade.vec2.normalizeInPlaceIfPossible (v)
Normalize a vector (so that its length is 1). Note that if the length of the vector is very close to 0, this operation will just return the original vector. Unlike the 'normalizeIfPossible' function, this one modifies the original vector
wade.vec2.rotate (v, angle)
Rotate a vector by an angle
wade.vec2.rotateInPlace (v, angle)
Rotate a vector by an angle. Unlike the 'rotate' function, this one modifies the original vector.
wade.vec2.scaleInPlace (v, s)
Scale a vector (that is, multiply the vector by a scalar). Unlike the 'scale' function, this one modifies the original vector.
wade.vec2.subInPlace (v1, v2)
Subtract two vectors and store the result in the first vector