Post Reply 
Orthogonal Matrix Test
11-04-2016, 07:31 PM
Post: #1
Orthogonal Matrix Test
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;
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)