(%i6) A : matrix([ 1, 2],[ 0, - 1]) $
B : matrix([ 0, - 1],[ 1, 3]) $
AB : mat_trace( transpose( B). A) $
normA : sqrt( mat_trace( transpose( A). A)) $
normB : sqrt( mat_trace( transpose( B). B)) $
print( "cos(", A, ",", B, ")=", AB /(( normA) *( normB))) $
0 errores, 0 advertencias cos( [ 1 2 0 1 ] , [ 0 1 1 3 ] )= 5 6 11
(%i7) round( % * 1000) / 1000, numer ;
(%o7) 0.615

Created with wxMaxima.