Matrix perform rotation at a line

ncchieh

New member
Joined
Aug 14, 2019
Messages
11
I want to ask is my flow is correct
T1 = translate line PQ to origin
T2 = rotate Q to x-axis
T3 = reverse T2
T4 = reverse T1

If my flow is correct, may I ask how to get Q to x-axis
I only learnt rotation at X/Y/Z axis, so I need to get the line PQ to one of the axis
 

Attachments

  • IMG_20191220_140218.jpg
    IMG_20191220_140218.jpg
    267.6 KB · Views: 2
Well, you can't "translate line PQ to origin" because the origin is a point not a line! You mean "translate point P (or point Q) to origin". And you can't "rotate Q to x-axis" because the x-axis is a line not a point! Here you mean "rotate PQ to x-axis" (or, perhaps better. "rotate PQ to z-axis" so that your rotation is in the xy-plane). And you seem to have forgotten to actually do the original rotation between the second and third lines.

Let's say point P is (x0,y0,z0)\displaystyle (x_0, y_0, z_0) and Q is (x1,y1,z1)\displaystyle (x_1, y_1, z_1). The "translate P to origin" is x>xx+x0\displaystyle x-> x- x+x_0, y>yy0\displaystyle y-> y- y_0 and z>zz0\displaystyle z-> z- z_0. Q becomes (x2,y2,z2)=(x1x0,y1y0,z1z0)\displaystyle (x_2, y_2, z_2)= (x_1- x_0, y_1- y_0, z_1- z_0). To rotate that to the z-axis I would divide it into two rotations, one about the z-axis so that the x coordinate becomes 0 and (to preserve length) the y coordinate becomes r=x22+y22\displaystyle r= \sqrt{x_2^2+ y_2^2}.

Since a rotation matrix is anti-symmetric, we want [ab0ba0001][x2y2z2]=[ax2+by2ay2bx2z2]=[0rz2]\displaystyle \begin{bmatrix} a & b & 0 \\ -b & a & 0 \\ 0 & 0 & 1\end{bmatrix}\begin{bmatrix} x_2 \\ y_2 \\ z_2\end{bmatrix}= \begin{bmatrix}ax_2+ by_2 \\ ay_2-bx_2 \\ z_2\end{bmatrix}= \begin{bmatrix}0 \\ r \\ z_2\end{bmatrix}.
So we must have ax2+by2=0\displaystyle ax_2+ by_2= 0 and ay2bx2=r\displaystyle ay_2- bx_2= r. We have calculated x2\displaystyle x_2 and y2\displaystyle y_2 so can solve those equations for a and b.
Now rotate around the x-axis to get [00ρ]\displaystyle \begin{bmatrix} 0 \\ 0 \\ \rho\end{bmatrix} where ρ=r2+z22=x22+y22+z22\displaystyle \rho= \sqrt{r^2+ z_2^2}= \sqrt{x_2^2+ y_2^2+ z_2^2}. To do that we must have [1000ab0ba][0rz3]=[0ar+bz2br+az2]=[00ρ]\displaystyle \begin{bmatrix}1 & 0 & 0 \\0 & a & b \\ 0 & -b & a \end{bmatrix}\begin{bmatrix} 0 \\ r \\ z_3 \end{bmatrix}= \begin{bmatrix}0 \\ ar+ bz_2 \\ -br+ az_2\end{bmatrix}= \begin{bmatrix}0 \\ 0 \\ \rho\end{bmatrix}.

So we must have ar+bz2=0\displaystyle ar+ bz_2= 0 and br+az2=ρ\displaystyle -br+ az_2= \rho. Again, solve those two equations for a and b.
 
Last edited:
Top