initialises a new instance of Vector2.
Initial x coordinate.
Initial y coordinate.
The length (magnitude) of the vector.
A new normalized (unit length) version of this vector. Does not mutate the original vector.
X coordinate.
Y coordinate.
Adds another vector to this one (mutates).
The vector to add.
This vector for chaining.
Creates a new vector with the same x and y values as this one.
A new Vector2 instance.
Copies the components of another vector into this one.
The vector to copy from.
This vector for chaining.
Multiplies this vector by a scalar (mutates).
The value to multiply by.
This vector for chaining.
Normalizes this vector in place.
This vector for chaining.
Sets the components of this vector.
New x coordinate.
New y coordinate.
This vector for chaining.
Subtracts another vector from this one (mutates).
The vector to subtract.
This vector for chaining.
StaticdistanceStaticdot
Class representing a 2D vector or point. Implements a fluent, mutating API to reduce object allocations.