INTERFACE R4x4; (* Operations on 4x4 matrices: linear maps of R^4. Created 93-04-31 by Marcos C. Carrard. Based on R4x4.pas by J. Stolfi. Last edited by stolfi *) IMPORT R4, Wr; TYPE T = ARRAY [0..3], [0..3] OF REAL; CONST Null = T{R4.Zero, ..}; Identity = T{ R4.T{1.0, 0.0, 0.0, 0.0}, R4.T{0.0, 1.0, 0.0, 0.0}, R4.T{0.0, 0.0, 1.0, 0.0}, R4.T{0.0, 0.0, 0.0, 1.0} }; PROCEDURE MapRow(READONLY x: R4.T; READONLY m: T): R4.T; (* Returns the product of row vector "x" by matrix "m". *) PROCEDURE MapCol(READONLY m: T; READONLY x: R4.T): R4.T; (* Returns the product of matrix "m" by column vector "x". *) PROCEDURE Mul(READONLY m, n: T): T; (* Returns the product OF matrices "m" and "n", in that order. *) PROCEDURE Det(READONLY m: T): LONGREAL; (* Returns the determinant of matrix "m". *) PROCEDURE Inv(READONLY m: T): T; (* Returns the inverse of matrix "m". Assumes the determinant is non-zero. *) PROCEDURE Adj(READONLY m: T): T; (* Returns the adjoint of matrix "m", such that "m * result = I * Det(m)" *) PROCEDURE Print(wr: Wr.T; READONLY m: T); (* Prints the matrix to the given writer. *) END R4x4.