The x component of the vector. Default is 0.
The y component of the vector. Default is 0.
The x component of the vector.
The y component of the vector.
Alias for y.
Alias for y.
Alias for x.
Alias for x.
Adds the scalar value s to the x, y and z components of this vector.
The scalar value to add.
Computes the angle in radians of this vector with respect to the positive x-axis.
Rounds this vector's components up to the nearest integer value.
If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value. If this vector's x or y value is less than the min vector's x or y value, it is replaced by the corresponding value.
The vector with the minimum x, y and z values used for clamping this vector.
The vector with the maximum x, y and z values used for clamping this vector.
If this vector's length is greater than the max value, the vector will be scaled down so its length is the max value. If this vector's length is less than the min value, the vector will be scaled up so its length is the min value.
The minimum value the length will be clamped to.
The maximum value the length will be clamped to.
If this vector's x or y values are greater than the max value, they are replaced by the maxVal value. If this vector's x or y values are less than the min value, they are replaced by the minVal value.
The minimum value used for clamping this vector.
The maximum value used for clamping this vector.
Returns a new vector with the same x and y values as this one.
Calculates the distance from this vector to v.
The second vector to calculate the distance to (the first one being this vector).
Calculates the squared distance from this vector to v. If you are just comparing the distance with another distance, you should compare the distance squared instead as it is slightly more efficient to calculate.
The second to calculate the squared distance to (the first one being this vector).
Divides this vector by the scalar s. Each component of this vector is divided by the same value s. Set this vector to (0, 0) if s == 0.
The value to divide each component of this vector with.
Calculates the dot product of this vector and v.
The other vector to calculate the dot product with.
Checks for strict equality of this vector and v.
The other vector to compare this one to.
Rounds this vector's components down to the nearest integer value.
Sets this vector's x value to be array[offset+0] amd y value to be array[offset+1].
The array of format [x, y] used to construct this vector.
An offset into the array from where to start reading the components.
Gets the value of the index-th component of the vector. Index 0 corresponds to the x component and 1 is y.
The index (0 or 1) of the component to get.
Computes the Euclidean length (straight-line length) from (0, 0, 0) to this vector's (x, y). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
Computes the Manhattan length of this vector.
Computes the square of the Euclidean length (straight-line length) from (0, 0) to this vector's (x, y). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
Linearly interpolates between this vector and v by alpha amount (alpha=0 returns this vector, while alpha=1 returns v) and stores the result into this vector.
The vector to interpolate this one towards.
The interpolation factor, typically in the closed interval [0, 1].
Multiplies this vector by the scalar s. Each component of this vector is multiplied by the same value s.
The value to multiply each component of this vector by.
Inverts this vector, i.e. sets x=-x and y=-y.
Converts this vector to a unit vector, that is, sets it equal to a vector with the same direction as this one, but with a length of 1.
Rounds this vector's components to the nearest integer value.
Rounds this vector's components towards zero (up if negative, down if positive) to an integer value.
Sets the x and y components of this vector to the provided ones.
The x component of the vector.
The y component of the vector.
Sets the index-th component of this vector to the provided value. Index 0 corresponds to the x component and 1 is y.
The index (0 or 1) of the component to set.
The value to set the component of this vector to.
Set this vector to a vector with the same direction as this one, but a length of l.
The length to set this vector to.
Sets the x and y components of this vector to the same scalar value.
The value to set all the components of this vector to.
Sets this vector's x component to the provided value.
The value to set the x component to.
Sets this vector's y component to the provided value.
The value to set the y component to.
Subtracts the scalar s from this vector's x, y and z components.
The value to subtract to the x and y components of this vector.
Returns the components of this vector in an array of format [x, y].
The array to store the compoments of the vector in. If not specified, a new array will be created.
An offset into the array where to write the elements of this vector.
Creates a new Vector3