Home > @josh-brown/vector > MatrixBuilder > identity
Constructs a size x size identity matrix
Signature:
identity(size: number): M;|
Parameter |
Type |
Description |
|---|---|---|
|
size |
number |
The dimension of the vector space for which the new matrix is the identity |
Returns:
M
The new matrix
const I3 = matrixBuilder.identity(3);
// [ 1 0 0 ]
// [ 0 1 0 ]
// [ 0 0 1 ]