The angle of the vector in radians.
The magnitude (length) of the vector.
Draws the vector on a canvas.
The 2D rendering context of the canvas.
The origin point from which the vector starts, defaulting to [0, 0]
.
Optional
options: { color?: string }Additional options, such as stroke color.
Static
addStatic
averageStatic
from
Represents a 2D vector and provides various operations for vector arithmetic and transformations.
This class is useful for geometric computations, transformations, and rendering in 2D space.