Rotation of a Plane in 3d about a line

29 Views Asked by At

I have a set of points in the XY planes, I want to translate them all to the YZ plane by rotating about a line. Basically,

Here, in this cube

Imagine I have a list of points on 2376 plane, I want to translate those points in such a way that the points on plane 2367 land on the same location on the plane 2341. Is there a possible rotation matrix for this?

1

There are 1 best solutions below

0
On BEST ANSWER

Sure. I'm not going to tell you the answer, because I want to show you how to find the answer yourself. Teach a person to fish, and they will be happy fishing for the rest of their life, and so on :).

First, consider counterclockwise rotation on a 2D plane: $$\left[ \begin{matrix} x_1 \\ y_1 \end{matrix} \right] = \left[ \begin{matrix} 0 & -1 \\ 1 & 0 \end{matrix} \right] \left[ \begin{matrix} x_0 \\ y_0 \end{matrix} \right] \tag{1}\label{AC1}$$ Essentially, $\eqref{AC1}$ is just $$\left\lbrace\begin{aligned} x_1 &= -y_0 \\ y_1 &= x_0 \end{aligned}\right.$$ Feel free to try some coordinate pairs to see how this works. As an example, $(1,0) \to (0,1) \to (-1,0) \to (0,-1) \to (1,0)$. Drawing the points on a paper, or say at Desmos, can be very useful here.

Second, consider the identity transformation in 3D: $$\left[ \begin{matrix} x_1 \\ y_1 \\ z_1 \end{matrix} \right] = \left[ \begin{matrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} \right] \left[ \begin{matrix} x_0 \\ y_0 \\ z_0 \end{matrix} \right] \tag{2}\label{AC2}$$ Essentially, the rows corresponding to the coordinate axis that stays put, are all zeros except $1$ on the diagonal. If you play with this for a second, you'll realize why that is.

We can combine the two, by ignoring the row and column that corresponds to the coordinate axis that stays unchanged. This gives us three rotation matrices: $\mathbf{R}_{xy}$ rotates the $xy$ plane by ninety degrees, leaving $z$ coordinates intact: $$\mathbf{R}_{xy} = \left[ \begin{matrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{matrix} \right ] \tag{XY}\label{ACXY}$$ $\mathbf{R}_{xz}$ rotates the $xz$ plane by ninety degrees, leaving $y$ coordinates intact: $$\mathbf{R}_{xz} = \left[ \begin{matrix} 0 & 0 & -1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \end{matrix} \right ] \tag{XZ}\label{ACXZ}$$ $\mathbf{R}_{yz}$ rotates the $yz$ plane by ninety degrees, leaving $x$ coordinates intact: $$\mathbf{R}_{yz} = \left[ \begin{matrix} 1 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & 0 \end{matrix} \right ] \tag{YZ}\label{ACYZ}$$ (Yes, one of those is the matrix OP is looking for, I believe.)

Pure rotation and mirroring matrices that do not scale or skew are orthonormal. Their inverse is their transpose, $$\mathbf{R}^{-1} = \mathbf{R}^{T}$$ which means that if you want to rotate in the other direction, just transpose the matrix. (Rotation in the opposite direction is obviously the inverse rotation, right?)