aninest root / Vec2
Vec2
A collection of 2D vector math functions and a few other generic scalar operations.
Description
Vectors are represented as {x: number, y: number}
and are meant to be immutable, following a functional programming style.
Index
Type Aliases
Type alias | Description |
---|---|
Vec2 | A 2D vector. |
Variables
Variable | Description |
---|---|
ZERO_VEC2 | A 2D vector with x and y set to 0. |
Functions
Function | Description |
---|---|
addVec | - |
bezier | - |
clamp | - |
copy | - |
cross | - |
distanceTo | - |
distanceTo2 | - |
divScalar | - |
divVec | - |
dot | - |
lerp | - |
lerpFunc | - |
mag | - |
magSquared | - |
mapVec | - |
mulScalar | - |
mulVec | - |
newVec2 | - |
normalize | - |
rotate | - |
rotateAround | - |
subVec | - |
vecToIter | - |