Geometry/3D rotation plane around defined axis (line)
Perhaps you can help me to solve my rotation problem..
for example I have a plane with four points A(-200,100,0), B(200,-100,0), C(200,200,0), D(-200,200,0)
my question how to do a rotation of that plane about AB line (AB line as the axis of the rotation)? please refer to attachment image for more understanding.
I am really appreciate if you can give the step by step and tell me which matrix formula that I can use for that rotation
Make the line in the x-y plane y = -x/2 be the new x axis.
To do this, z stays the same.
This problem involves two stages.
1 The first is to find the new points with that line as the new x-axis.
The angle of rotation would be the angle that has tan(A) = -2.
This makes the new x and new y be (x*cosA+y*sinA, x*sinA+y*cosA).
To find the new point in 3D would be to multiply by the matrix
A B 0
C D 0
0 0 1
where A = cosA B = -sinA, C = -B, and D = A.
2 The second is to rotate it around that line now that the points have been converted so that is is the x-axis.
To rotate this by angle B around this line, find the distance of that point from the line and change the angle. The matrix to multiply by would be
1 0 0
0 E F
0 G H
where E = cosB, F = -sinB, G = -F, and H = E.