I am using Mathematica to solve a hw question. I have the following code:
R1 = {{1, 0, 0}, {0, Cos[ϕ], Sin[ϕ]}, {0, - Sin[ϕ], Cos[ϕ]}};
R2 = {{Cos[θ], 0, -Sin[θ]}, {0, 1, 0}, {Sin[θ], 0, Cos[θ]}};
R1R2 = R1.R2 // MatrixForm
R2R1 = R2.R1 // MatrixForm
(*For small angles, we know Sin[x] = x and Cos[x] = 1, so we use this substitution by using x = 1x10^-10*)
Ab = N[R1R2 /. {\[Theta] -> 1 10^-10, \[Phi] -> 1 10^-10,
Cos[\[Theta]] -> 1, Cos[\[Phi]] -> 1}] // MatrixForm
Bb = N[R2R1 /. {\[Theta] -> 1 10^-10, \[Phi] -> 1 10^-10,
Cos[\[Theta]] -> 1, Cos[\[Phi]] -> 1}] // MatrixForm
result = Ab - Bb;
result // MatrixForm
I am new to this community so I dont know how to paste the output. But essentially, what it looks like its doing is it shows Ab-Bb (the matrices on wither side of the minus sign), not the result of subtracting the two matrices.
Can someone help fix this?
// MatrixForm. For example:(R1R2 = R1 . R2) // MatrixForm. – JimB Oct 07 '23 at 18:28