Constructs a vector.
Optional
w: numberThis is the third component in the vector. This component is used when for example performing transformations. Then a matrix multiplication might result in the w component becoming not equal to 1. In this case one should normalize the vector so that w becomes one again to have a valid vector.
Why does this happen with matrix multiplications? Well most often it doesn't, for example translate operations or rotations don't cause this. But if you use Skew operations, this is might happen. I'd need to read up on it more myself to have a better answer.
Optional
wThis is the third component in the vector. This component is used when for example performing transformations. Then a matrix multiplication might result in the w component becoming not equal to 1. In this case one should normalize the vector so that w becomes one again to have a valid vector.
Why does this happen with matrix multiplications? Well most often it doesn't, for example translate operations or rotations don't cause this. But if you use Skew operations, this is might happen. I'd need to read up on it more myself to have a better answer.
Static
nullReturns the clockwise perpendicular vector to this one. A perpendicular vector can be found by defining a vector where the dot product equals 0. Now, there will be two perpendicular vectors, one that is defined clockwise, and one that is found counter clockwise.
Returns the scalar value of the cross product between this vector and v2. Normally cross product is performed in three dimensions, but here we assume z value equals 0, and returns then the size of the resulting z dimension.
Gives the dot product between the two vectors.
Return true if this vector is pointing in the same direction as the other vector.
Static
fromGenerated using TypeDoc
Represents a 2 dimensional vector.