Functions for manipulating vectors. It is Loosely based off of SkV3 in SkM44.h but Skia also has SkVec2 and Skv4. This combines them and works on vectors of any length.
Adds 2 vectors together, term by term, returning a new Vector.
Returns the cross product of the two vectors. Only works for length 3.
Returns the length(sub(a, b))
Returns the dot product of the two vectors.
Returns the length of this vector, which is always positive.
Returns the length squared of this vector.
Returns a new vector which is v multiplied by the scalar s.
Returns a normalized vector.
Subtracts vector b from vector a (termwise).
Functions for manipulating vectors. It is Loosely based off of SkV3 in SkM44.h but Skia also has SkVec2 and Skv4. This combines them and works on vectors of any length.