#How to multiple two rotation matrixes togheter

33 messages · Page 1 of 1 (latest)

wind rainBOT
sudden garden
#

Depending on what you’re doing, you should be able to just add the angles in a new rotation matrix

fierce parcel
#

im rotating a cube first 45 degrees around the z axis and then 45 degrees around the x axsis but i wanna combine theese two rotation matrixes to skip extra steps.

sudden garden
#

Oh then it’s slightly different

#

What are your two matrices, since you already said the angles are fixed

#

Then you can deal with the matrix as usual, with explicit values in case you’re not already doing that

fierce parcel
#

its just the x matrix and z matrix when i combine them i get this

cos 45 , 0 , 0
0 ,cos(45) * cos(45) , 0
0 , 0 , cos(45)

sudden garden
#

How exactly are you combining them?

fierce parcel
#

i just mutliple them togheter

sudden garden
#

I mean show your work

#

Since apparently you’re not doing it right if I understand you correctly?

fierce parcel
#

i did it on a piece of paper but its really hard to understand since i did most of the work in my head

#

i dont think im doing it right either, its just something i came up with on the spot

sudden garden
#

So what do you want help with?

fierce parcel
#

i wanna know how to combine two matrixes togheter

sudden garden
#

So give me your two matrices and I’ll show you

#

Also the order in which you do it matters

#

You want to multiple them in the order (x matrix) ( z matrix ), do you see why?

fierce parcel
#

its just the rotation matrix for Z and Y

#

i mean Z and X

#

and i wanna start with Z first

sudden garden
#

When multiplying matrices, you dot the row and columns, and the index of of each row and colum corresponds to which element

#

So for the first element of our product

#

We will dot (1,0,0) (the first row of the x matrix)

#

And (cos theta, sin theta, 0) (the first column of the z matrix)

#

What number do you get when you dot these?

#

When I say dot I mean dot product btw

fierce parcel
#

ahaaaa, its just how you caculate a regulat matrix, we did learn about matrix multiplication but i was thinking outside of the problem that it didnt occur in my mind ahahha, thanks for clarifying it

sudden garden
#

Ur welcome!

#

Yeah after all these are matrices

#

So it shouldn’t be different

#

However, it could be different in the sense that it’s easier to combine depending on which type of rotations you’re doing