q1=matrix([2/3],[2/3],[-1/3]])
q2=matrix([[-1/3],[2/3],[2/3]])
q1.transpose()*q2==0                               /* checking the condition for orthonormal vectors*/
Q=matrix([[2/3,-1/3],[2/3,2/3],[-1/3,2/3]])
Q.transpose()
Q.transpose()*Q                                    /* this results in an identity matrix*/
Q1=Q*Q.transpose()
Q1
A=Q*(Q.transpose()*Q).inverse()*(Q.transpose())    /* calculating the projection matrix over the two vectors q1,q2*/
A==Q1                                               /*checking if Q1 itself is the projection matrix*/

Strang-3.5-3.8-U (last edited 2010-12-18 07:28:56 by manishadeepthi)