scale

Append a scale transform inferred from arguments to the matrix m. This is equivalent to the expression

scale(...) * m
but actually save computation by knowing where the ones and zeros are in a pure scale matrix.

Examples

import gfx.math.approx : approxUlp;

immutable m = DMat3( 1, 2, 3, 4, 5, 6, 7, 8, 9 );

immutable expected = scale(4, 5) * m; // full multiplication
immutable result = scale(m, 4, 5);   // simplified multiplication

assert (approxUlp(expected, result));
import gfx.math.approx : approxUlp;

immutable m = DMat4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 );

immutable expected = scale(4, 5, 6) * m; // full multiplication
immutable result = scale(m, 4, 5, 6);   // simplified multiplication

assert (approxUlp(expected, result));

Meta