Static
lerpCreates a vector with X and Y passed through the BeetPxUtils.lerp individually.
Optional
opts: { Optional
clamp?: booleanStatic
maxCreates a vector which has the highest X and Y from two other given vectors.
Static
minCreates a vector which has the lowest X and Y from two other given vectors.
Static
minAn equivalent of [BpxVector2d.min(xy1, xy2), BpxVector2d.max(xy1, xy2)]
.
Static
ofAn equivalent of BpxVector2d.of(value, value)
.
Static
unitA full circle turn = 1. In other words: 0 deg = 0 turn, 90 deg = 0.25 turn, 180 deg = 0.5 turn, 270 deg = 0.75 turn.
A vector of a length 1, angled according to a given turnAngle
. E.g. (0, -1)
for an angle of -0.25
.
This definition makes the vector represented with its class names in those scenario where normally
you would see [object Object]
in logs.
A vector in which each component is an absolute value of the original value.
Addition.
Addition.
Addition.
A vector in which each component is a ceil rounding of the original value.
Creates a vector with X and Y passed through the BeetPxUtils.clamp individually.
Division.
Division.
Division.
If the vector has both of its components equal to the same components of a given vector.
If the vector has both of its components equal to a given value.
A vector in which each component is a floor rounding of the original value.
If the vector has both of its components greater than the same components of a given vector.
If the vector has both of its components greater than a given value.
If the vector has both of its components greater or equal to the same components of a given vector.
If the vector has both of its components greater or equal to a given value.
If the vector has both of its components lower than the same components of a given vector.
If the vector has both of its components lower than a given value.
If the vector has both of its components lower or equal to the same components of a given vector.
If the vector has both of its components lower or equal to a given value.
Creates a vector with X and Y passed through the BeetPxUtils.mod individually.
This variant of the method uses X and Y of another vector to run mod
on both X and Y
respectively.
Creates a vector with X and Y passed through the BeetPxUtils.mod individually.
This variant of the method uses a single value to run mod
on both X and Y
with it.
Creates a vector with X and Y passed through the BeetPxUtils.mod individually.
This variant of the method uses X and Y to run mod
on both X and Y
respectively.
Multiplication.
Multiplication.
Multiplication.
A vector in which each component is a negative of the original value.
A vector of same angle, but of length 1. Or 0, if the original vector was 0.
A vector in which each component is a rounding of the original value.
A vector in which each component is either -1
, 0
, or 1
to indicate the sign of the original value.
Subtraction.
Subtraction.
Subtraction.
This method is an equivalent of calling BeetPxUtils.trigAtan2 with both x
and y
of this vector as the params.
The "turn" of the vector. A full circle turn = 1. In other words: 0 deg = 0 turn, 90 deg = 0.25 turn, 180 deg = 0.5 turn, 270 deg = 0.75 turn.
A core building block for many pieces of the BeetPx API – a vector, which is 2D point representation of (X,Y).