Find determinant of matrix generated by array rotation | PHP program for finding determinant of generated matrix ; Function to calculate determinant ; Driver code
< ? php $ N = 3 ; function calcDeterminant ( $ arr ) { global $ N ; $ determinant = 0 ; for ( $ i = 0 ; $ i < $ N ; $ i ++ ) { $ determinant += pow ( $ arr [ $ i ] , 3 ) ; } $ determinant -= 3 * $ arr [ 0 ] * $ arr [ 1 ] * $ arr [ 2 ] ; return $ determinant ; } $ arr = array ( 4 , 5 , 3 ) ; echo calcDeterminant ( $ arr ) ; ? >