Protected
_xProtected
_yThe size (magnitude) of the Vector
Setting the size mutates the current vector
Can be used to set the size of the vector, be very careful using this, mutating vectors can cause hard to find bugs
Get the x component of the vector
Set the x component, THIS MUTATES the current vector. It is usually better to create a new vector.
Be very careful setting components on shared vectors, mutating shared vectors can cause hard to find bugs
Get the y component of the vector
Set the y component, THIS MUTATES the current vector. It is usually better to create a new vector.
Be very careful setting components on shared vectors, mutating shared vectors can cause hard to find bugs
Static
DownStatic
HalfStatic
LeftStatic
OneStatic
RightStatic
UpStatic
ZeroPerforms a 2D cross product with scalar. 2D cross products with a scalar return a vector.
The scalar to cross
Performs a 2D cross product with another vector. 2D cross products return a scalar value not a vector.
The vector to cross
The distance to another vector. If no other Vector is specified, this will return the [[magnitude]].
Optional
v: VectorThe other vector. Leave blank to use origin vector.
Performs a dot product with another vector
The vector to dot
Compares this point against another and tests for equality
The other point to compare to
Amount of euclidean distance off we are willing to tolerate
Optional
v: VectorStatic
crossStatic
distanceStatic
fromStatic
isChecks if vector is not null, undefined, or if any of its components are NaN or Infinity.
Static
maxStatic
min
A 2D vector on a plane.