© 2001 by CRC Press LLC
To verify whether or not the inverse matrix Ainv obtained in Output[6] indeed
satisfies the equations [A][A]
–1
= [I] which is the identity matrix, we apply Math-
ematica for matrix multiplication:
In[7]: = Iden = A.Ainv; MatrixForm[Iden]
Out[7]//MatrixForm =
10
01
A dot is to separate the two matrices A and Ainv which is to be multiplied in that
order. Output[7] proves that the computed matrix, Ainv, is the inverse of A! It should
be noted that D and I are two reserved variables in Mathematica for the determinant
of a matrix and the identity matrix. In their places, here Dif and Iden are adopted,
respectively. For further testing, we show that [A][A]
T
is a symmetric matrix:
In[8]: = S = A.AT; MatrixForm[S]
Out[8]//MatrixForm =
511
11 25
And, the unknown vector {X} in the matrix equation [A]{X} = {R} can be
solved easily if {R} is given and [A]
–1
are available:
In[9]: = R = {13,31}; X = Ainv.R
Out[9] = {5, 4}
The solution of x
1
= 5 and x
2
= 4 do satisfy the equations x
1
+ 2x
2
= 13 and 3x
1
+ 4x
2
= 31.
TRANSFORMATION OF COORDINATE SYSTEMS, ROTATION, AND ANIMATION
Matrix algebra can be effectively applied for transformation of coordinate sys-
tems. When the cartesian coordinate system, x-y-z, is rotated by an angle
z
about
the z-axis to arrive at the system x-y-z as shown in Figure 2, where z and z axes
coincide and directed outward normal to the plane of paper, the new coordinates of
a typical point P whose coordinates are (x
P
,y
P
,z
P
) can be easily obtained as follows:
′
=−
()
=
()
+
()
=+
′
=−
()
=
()
−
()
=+
xOP OP OP
xy
yOP OP OP
xy
PPz PzPz
Pzpz
PPz Pz Pz
pzpz
cos cos cos sin sin
cos sin
sin sin cos cos sin
sin sin
θθ θ θ θ θ
θθ
θθ θ θ θ θ
θθ