Equation for finding vertices of a rectangular prism after rotations

90 Views Asked by At

I am trying to find an equation that will help me find the vertices of a rectangular prism after it has been rotated about its center point in the x,y, and z dimensions.

For example, I am given a rectangular prism with side lengths: l = 10, w =4, h = 1 (l corresponding to x axis, w to y axis, and h to z axis ). I also know that the prism has been rotated30 degrees about the x axis, 45 degrees about the y axis, and 20 degrees about the z axis. If my center point is (1,3,5), I would like to find an equation to determine where each of my vertices will end up after the prism has been rotated fully.

I have found many sources that can give me an answer in 2 dimensions but I have yet to see a source that helps me find this equation in all 3 dimensions I am looking for.

Any help would be greatly appreciated! (I don't necessarily need the answer to the example given above, just an equation for how to solve it would help me out tremendously! )

1

There are 1 best solutions below

0
On

The image of a point $p$ under a rotation about an axis passing through point $C$ is given by the affine transformation:

$p' = C + R (p - C) $

Where $R$ is the rotation matrix which is uniquely specified in terms of the unit vector that points along the axis of rotation and the angle of rotation $\theta$. The $3$ standard rotation matrices about the $x$, $y$, $z$ axes are given by:

$R_x = \begin{bmatrix} 1 && 0 && 0 \\ 0 && \cos \theta && - \sin \theta \\ 0 && \sin \theta && \cos \theta \end{bmatrix} $

$R_y = \begin{bmatrix} \cos \theta && 0 && \sin \theta \\ 0 && 1 && 0 \\ - \sin \theta && 0 && \cos \theta \end{bmatrix} $

$R_z = \begin{bmatrix} \cos \theta && \sin \theta && 0 \\ - \sin \theta && \cos \theta && 0 \\ 0 && 0 && 1 \end{bmatrix}$

And the rotation matrix about an arbitrary axis whose unit vector is $a$ is given by:

$ R_a = a a^T + (I - a a ^T ) \cos \theta + S_a \sin \theta $

where

$S_a = \begin{bmatrix} 0 && - a_z && a_y \\ a_z && 0 && - a_x \\ -a_y && a_x && 0 \end{bmatrix}$

Finally, if you have more than one rotation then the overall rotation matrix is the product of these rotation matrices. So, if you want to rotate about the $x$ axis then about the $y$ axis, then about the $z$ axis, then the overall rotation is

$R = R_z R_y R_x $

This comes from applying the rotation matrix repeatedly for each for the standard rotations in order, and is of course applicable in the same way to rotations about arbitrary axes.