the X value of the Vector
the Y value of the Vector
Optional
opt_z: numberthe Z value of the Vector (optional, zero is default value)
Adds the given GenericVector to this MutableVector.
vector to add
this MutableVector for chaining
Returns distance-squared between this MutableVector and another GenericVector regarding both as points in space. Computationally inexpensive because it only uses multiplication, no square root.
vector to calculate distance to
distance squared between this point and the given point
Returns distance between this MutableVector and another GenericVector regarding both as points in space. Computationally expensive because it involves as square root.
vector to calculate distance to
distance between this point and the given point
Divides this MutableVector by the given factor.
factor by which to divide this vector, must be greater than Vector.TINY_POSITIVE
this MutableVector for chaining
if factor is less than Vector.TINY_POSITIVE
Returns true if and only if the other object is a GenericVector with the same values.
the object to compare to
true iff the other object is a GenericVector with the same values.
Computationally cheap version of length
which avoids the square root; returns sum of absolute value of each component x, y, z
.
sum of absolute value of each component x, y, z
.
Multiplies this MutableVector by the given factor.
factor by which to multiply this vector
this MutableVector for chaining
Returns true
if this MutableVector is nearly equal to another GenericVector.
the vector to compare to
Optional
opt_tolerance: numberoptional tolerance for equality test
true if the vectors are similar
Returns the normalized version of this MutableVector, having unit length and the same direction.
normalized version of this MutableVector, having unit length and the same direction
if this MutableVector has length less than Vector.TINY_POSITIVE
Modifies this MutableVector to have the given values.
the X value of the vector
the Y value of the vector
Optional
z: numberthe Z value of the vector, uses zero if not defined
this vector
Modifies this MutableVector to have the same values as the given GenericVector.
vector to copy from
this vector
Subtracts the given GenericVector from this MutableVector.
vector to subtract
difference of this vector and given vector
Static
cloneReturns a new MutableVector having the same values as the input GenericVector.
vector to copy
a new MutableVector with the same values as the input GenericVector
Generated using TypeDoc
Mutable vector defines a point in 2D or 3D and can be altered after creation.