0
$\begingroup$

I want to rotate a point (3,4,5) by an angle 45 degrees(0.785398 rad) in 3D space. I have used the standard DCM matrix in the order Rx, Ry and Rz. Where, theta = 0.785398, Rx= ( [ 1, 0, 0] [ 0, cos(theta), sin(theta)] [ 0, -sin(theta), cos(theta)])

Ry= ([ cos(theta), 0, -sin(theta)] [ 0, 1, 0] [sin(theta), 0, cos(theta)])

Rz= ([ cos(theta), sin(theta), 0 ] [ -sin(theta), cos(theta) , 0] [ 0,0,1 ])

R = Rx(0.785398) * Ry(0.785398) * Rz(0.785398)

x = R * x We get a 3 x 1 matrix after this multiplication. The resultant matrix for the value of X,Y and Z is found by adding all the values in this case I got X = [[ 1.50000049] [-0.43934] [ 2.56065985]] therefore X= 3.62

y = R * y

Y = [[ 2] [ 3.41421352] [-0.58578667]] therefore Y= 4.82

z = R * z

Z = [[-3.53553333] [ 2.5 ] [ 2.50000082]] therefore Z= 1.46

Ideally even after the rotation of the point the length of the point from origin should remain the same but here it is varying. Length before rotation is 7.071 and length after rotation is 6.210.Could you tell me if anything is wrong.

My basic idea is to rotate the 3D point independently along the three axis by a certain angle to get the new position of of the same point now when the axis are rotated by certain angle.Pls suggest some approach.

$\endgroup$

1 Answer 1

2
$\begingroup$

1st Rotation of 45 degrees about what axis? $$x_{new} = R_x(45)R_y(45)R_z(45) x_{old}$$ describes 3 rotations of 45 degrees in all the fixed axis. In that order ($R_x(45)R_y(45)R_z(45)$), you first rotate the point around z axis, then rotate the new point around the fixed y axis, and finally you rotate the new point around the fixed x axis.

If you want to rotate around a random axis, you should use rodriguez formula .

2nd In the case you describe in the post, as you know the angle, you can calculate the R matrix, it is:

$$ R = \begin{bmatrix} 0.5000 & -0.5000 & 0.7071 \\ 0.8536 & 0.1464 & -0.5000\\ 0.1464 & 0.8536 & 0.5000 \end{bmatrix} $$

so then you can get the new position of the point. It is: $x_{new} = Rx = [ 3.0355, \ 0.6464,\ 6.3536]^T$

extra I suggest you to look in some relavant theory. Here are some good sources online:

mecharithm, Modern Robotics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.