import gfx.math.approx : approxUlp;
import std.math : PI;
immutable m = DMat3( 1, 2, 3, 4, 5, 6, 7, 8, 9 );
immutable expected = rotation!double(PI) * m; // full multiplication
immutable result = rotate(m, PI); // simplified multiplication
assert (approxUlp(expected, result));
import gfx.math.approx : approxUlp;
import std.math : PI;
immutable m = DMat4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 );
immutable angle = PI;
immutable v = fvec(3, 4, 5);
immutable expected = rotation(angle, v) * m; // full multiplication
immutable result = rotate(m, angle, v); // simplified multiplication
assert (approxUlp(expected, result));
Append a rotation transform inferred from arguments to the matrix m. This is equivalent to the expression
but actually save computation by knowing where the ones and zeros are in a pure rotation matrix.