lerp method

Matrix<T> lerp(
  1. Matrix<T> other,
  2. num t
)

Returns a view of the element-wise linear interpolation between this Matrix and other with a factor of t. If t is equal to 0 the result is this, if t is equal to 1 the result is other.

Implementation

Matrix<T> lerp(Matrix<T> other, num t) {
  final add = dataType.field.add, scale = dataType.field.scale;
  return binaryOperation(
      other, (a, b) => add(scale(a, 1.0 - t), scale(b, t)));
}