x component.
y component.
Adds the current vector with another one and return this
specified vector
Adds the current vector with another one and return this
The x value of specified vector
The y value of specified vector
Calculates radian angle between two vectors
specified vector
The angle between the current vector and the specified vector (in radians); if there are zero vectors in the current vector and the specified vector, 0 is returned.
clone a Vec2 value
Calculates the cross product with another vector.
specified vector
out
Element-wisely divides this vector with another one, and return this.
specified vector
Element-wisely divides this vector with another one, and return this.
The x value of specified vector
The y value of specified vector
Calculates the dot product with another vector
specified vector
The result of calculates the dot product with another vector
Check whether the vector approximately equals another one.
Specified vector
The error allowed. It`s should be a non-negative number.
Returns true
when the components of both vectors are equal within the specified range of error; otherwise it returns false
.
Check whether the vector approximately equals another one.
The x value of specified vector
The y value of specified vector
The error allowed. It`s should be a non-negative number.
Returns true
when the components of both vectors are equal within the specified range of error; otherwise it returns false
.
Returns the length of this vector.
Length of vector
Returns the squared length of this vector.
the squared length of this vector
Calculate linear interpolation result between this vector and another one with given ratio.
Target vector
The interpolation coefficient.The range is [0,1].
Multiplies the current vector with another one and return this
specified vector
Multiplies the current vector with another one and return this
The x value of specified vector
The y value of specified vector
Multiplies the current vector with a number, and returns this.
scalar number
Sets each component of this vector with its negative value
Normalize the current vector.
Projects the current vector on another one
specified vector
Rotates the current vector by an angle in radian value
radius of rotation
Set the current vector value with the given vector.
Specified vector
this
Set the value of each component of the current vector.
x value
y value
this
Get angle in radian between this and vector with direction.
specified vector
The signed angle between the current vector and the specified vector (in radians); if there is a zero vector in the current vector and the specified vector, 0 is returned.
Check whether the current vector strictly equals another Vec2.
specified vector
Returns true
when the components of both vectors are equal within the specified range of error; otherwise it returns false
.
Check whether the current vector strictly equals another Vec2.
The x value of specified vector
The y value of specified vector
Returns true
when the components of both vectors are equal within the specified range of error; otherwise it returns false
.
Subtracts one vector from this, and returns this.
specified vector
Subtracts one vector from this, and returns this.
The x value of specified vector
The y value of specified vector
Transform to string with vector information.
The string with vector information
Transforms the vec2 with a mat4. 3rd vector component is implicitly '0', 4th vector component is implicitly '1'
matrix to transform with
Element-wise vector addition and save the results to out vector object
Calculates the radian angle between two vectors
Rounds up by elements of the vector and save the results to out vector object
Copy the target vector and save the results to out vector object
Calculates the euclidean distance of two vectors
Element-wise vector division and save the results to out vector object
Calculates the dot product of the vector
Check whether the two given vectors are approximately equivalent
Element-wise rounds down of the current vector and save the results to the out vector
Converts the given array to a vector
Array Start Offset
Sets each element to its inverse value, zero value will become Infinity
Sets each element to its inverse value, zero value will remain zero
Calculates the length of the vector
Calculates the squared length of the vector
Calculates the linear interpolation between two vectors with a given ratio
Calculates element-wise maximum values and save to the out vector
Calculates element-wise minimum values and save to the out vector
Element-wise vector multiplication and save the results to out vector object
Vector scalar multiplication and save the results to out vector object
Sets each element to its negative value
Generates a uniformly distributed random vector points from center to the surface of the unit sphere
vector length
Calculates element-wise round results and save to the out vector
Element-wise multiplication and addition with the equation: a + b * scale
Sets the out vector with the given x and y values
Calculates the squared euclidean distance of two vectors
Gets the string representation of the given vector
Check the equality of the two given vectors
Element-wise vector subtraction and save the results to out vector object
Converts the given vector to an array
Array Start Offset
Generated using TypeDoc
Representation of 2D vectors and points.