Optionalx: number = 0x value of the vector
Optionaly: number = 0y value of the vector
Update this vector values to absolute values
Reference to this object for method chaining
return the angle between this vector and the passed one
other vector
angle in radians
Clamp the vector value within the specified value range
minimum component value
maximum component value
new me.Vector2d
Clamp this vector value within the specified value range
minimum component value
maximum component value
Reference to this object for method chaining
return the cross product of this vector and the passed one
other vector
The cross product.
Calculates the Euclidean distance between this vector and another vector.
The vector to which the distance is calculated.
The Euclidean distance between this vector and the given vector.
Divide this vector values by the passed value
the value to divide the vector by
Reference to this object for method chaining
return the dot product of this vector and the passed one
other vector
The dot product.
return the length (magnitude) of this vector
the length of this vector
return the square length of this vector
The length^2 of this vector.
interpolate the position of this vector towards the given one by the given maximum step.
vector to rotate towards
the maximum step per iteration (Negative values will push the vector away from the target)
Reference to this object for method chaining
normalize this vector (scale the vector so that its magnitude is 1)
Reference to this object for method chaining
change this vector to be perpendicular to what it was before.
(Effectively rotates it 90 degrees in a clockwise direction)
Reference to this object for method chaining
Multiply this vector values by the given scalar
x scale value
Optionaly: number = xy scale value, if not passed, it uses the x value
Reference to this object for method chaining
set the Vector x and y properties to the given values
x component of the vector
y component of the vector
Reference to this object for method chaining
Convert this vector into 2d coordinate space
Reference to this object for method chaining
Convert this vector into isometric coordinate space
Reference to this object for method chaining
convert the object to a string representation
stringified representation of this vector
a generic 2D Vector Object