scale method

Mat3 scale(
  1. Vec3 vector, [
  2. Mat3? target
])

Scale each column of the matrix

Implementation

Mat3 scale(Vec3 vector,[Mat3? target]) {
  target ??= Mat3();
  final e = elements;
  final t = target.elements;
  for (int i = 0; i != 3; i++) {
    t[3 * i + 0] = vector.x * e[3 * i + 0];
    t[3 * i + 1] = vector.y * e[3 * i + 1];
    t[3 * i + 2] = vector.z * e[3 * i + 2];
  }
  return target;
}