- #1
STENDEC
- 21
- 0
I'm trying to rotate a point about the origin [itex](0,0,0)[/itex] and starting with an identity matrix, this works fine for the x- and y-rotation axes, but fails with the z-axis, where the point just sits in place.
[itex]\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}
M_{ID}
\times
M_Z
\begin{bmatrix}
cos(\phi) & sin(\phi) & 0 \\
-sin(\phi) & cos(\phi) & 0 \\
0 & 0 & 1
\end{bmatrix}
[/itex]
I imagine the point is sitting on the z-axis, thus rotating around itself. I'm not sure how to modify the identity matrix to reposition it so that it rotates around the origin like with the other axes. I hope someone can point out to me what's needed here. Thanks.
[itex]\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}
M_{ID}
\times
M_Z
\begin{bmatrix}
cos(\phi) & sin(\phi) & 0 \\
-sin(\phi) & cos(\phi) & 0 \\
0 & 0 & 1
\end{bmatrix}
[/itex]
I imagine the point is sitting on the z-axis, thus rotating around itself. I'm not sure how to modify the identity matrix to reposition it so that it rotates around the origin like with the other axes. I hope someone can point out to me what's needed here. Thanks.