Matrix.identity

Returns an identity matrix.

struct Matrix(T, ubyte R, ubyte C = R)
static
identity
()
if (
R >= 2 &&
R <= 4
&&
C >= 2
&&
C <= 4
)

Examples

const matrix = Matrix!(uint, 3).identity();
assert(matrix.v == [1, 0, 0, /**/ 0, 1, 0, /**/ 0, 0, 1]);

Meta