Construct a new Vector2 with identical x and y components.
Value of x and y component
Construct a new Vector2.
Initial x component of vector
Initial y component of vector
Construct a new Vector2 using component from another vector.
Construct a new Vector2 using an object with an x and y key.
Construct a new Vector2.
Rest
...nums: number[]A series of numbers
Does the vector mutate?
Length variable to use vector as array.
Magnitude of vector.
Alternative getter/setter for x component.
Alternative getter/setter for y component.
Static
downStatic
leftStatic
negativeStatic
oneStatic
positiveStatic
rightStatic
upStatic
zeroAdd values of given vector to target vector.
X component to add
Y component to add
Resulting vector
Add values of given vector to target vector.
Vector to add
Resulting vector
[Mutation] Set both components of vector.
Value of x and y component
Reference to self
[Mutation] Set both components of vector.
New x component of vector
New y component of vector
Reference to self
[Mutation] Set both components of vector.
Vector-like object with values on the format: [ x, y ]
Reference to self
target - this
Subtract this vector from given vector.
X component to subtract from
Y component to subtract from
Resulting vector
target - this
Subtract this vector from given vector.
Vector to to subtract from
Resulting vector
Static
addStatic
angleStatic
angleStatic
angleStatic
angleStatic
crossStatic
distanceStatic
divideStatic
dotStatic
equalsStatic
isStatic
lerpStatic
lerpStatic
multiplyStatic
signedStatic
signedStatic
subGenerated using TypeDoc
Vector2 class with x and y component. Can also be used as an array with two indices, i.e. using [0] and [1].
Alias
Vector2