HP Forums

Full Version: Orthogonal Matrix Test
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For the square matrix M, it is orthogonal when either of the following conditions are met:

(I) M * M^T = M^T * M = I
(II) M^-1 = M^T

The program presented on this blog entry will use the first test. Since matrices, unfortunately, cannot be directly compared on the Casio graphing calculators, a work around with two FOR loops is implemented.

HP Prime Program ORTHOG

Code:
EXPORT ORTHOG(m)
BEGIN
// 2016-11-01 EWS
// orthogonal test
LOCAL n,p,s;
s≔SIZE(m);
s≔s(1);
n≔TRN(m)*m;
p≔IDENMAT(s);
IF n==p THEN
RETURN 1;
ELSE
RETURN 0;
END;
END;
Reference URL's