src/MatrixMath.php
public static function identity($type = Matrix44::class) : Matrix {
        $matrix = new $type();

        for ($i=0;$i<$type::ROWS;$i++) {
            for ($j=0;$j<$type::COLUMNS;$j++) {
                $matrix[$i][$j] = $i === $j ? 1 : 0;
            }
        }
        return $matrix;
    }
public static function identity($type = Matrix44::class) : Matrix {
        $matrix = new $type();

        for ($i=0;$i<$type::ROWS;$i++) {
            for ($j=0;$j<$type::COLUMNS;$j++) {
                $matrix[$i][$j] = $i === $j ? 1 : 0;
            }
        }
        return $matrix;
    }
public static function identity ( $ type = Matrix44 :: class ) : Matrix { $ matrix = new $ type ( ) ; for ( $ i = 0 ; $ i < $ type :: ROWS ; $ i ++ ) { for ( $ j = 0 ; $ j < $ type :: COLUMNS ; $ j ++ ) { $ matrix [ $ i ] [ $ j ] = $ i === $ j ? 1 : 0 ; } } return $ matrix ; }
Create an identity matrix of given matrix type.

@param string $type defaults to Matrix44
@return Matrix
Create an identity matrix of given matrix type .