transformMat2 function

List<double> transformMat2(
  1. List<double> out,
  2. List<double> a,
  3. List<double> m
)

Transforms the vec2 with a mat2

@param {vec2} out the receiving vector @param {ReadonlyVec2} a the vector to transform @param {ReadonlyMat2} m matrix to transform with @returns {vec2} out

Implementation

List<double> transformMat2(List<double> out, List<double> a, List<double> m) {
  var x = a[0], y = a[1];
  out[0] = m[0] * x + m[2] * y;
  out[1] = m[1] * x + m[3] * y;
  return out;
}