# Yaw,Pitch and Roll Multiplication

1. May 15, 2014

### abubakr

If I have (α1,β1,γ1) and (α2,β2,γ2) as two set of rotation angles in radians.Where α is Yaw of α about z axis, β is pitch about y axis and γ is roll about x axis. My question is when I multiply the two rotation sets what would be the result? Would it be simple addition of angles if I extract the angle information from result i-e (α1+α2,β1+β2,γ1+γ2)?

2. May 15, 2014

### D H

Staff Emeritus
No. It doesn't work like that.

3. May 15, 2014

### HallsofIvy

You need to multiply the matrices representing the rotations.
A rotation of angle $\alpha$ about the z axis is given by
$$\begin{bmatrix}cos(\alpha) & -sin(\alpha) & 0 \\ sin(\alpha) & cos(\alpha) & 0 \\ 0 & 0 & 1\end{bmatrix}$$

A rotation of angle $\beta$ about the y axis is given by
$$\begin{bmatrix}cos(\beta) & 0 & sin(\beta)\\ 0 & 1 & 0 \\ -sin(\beta) & 0 & cos(\beta)\end{bmatrix}$$

A rotation of angle $\gamma$ about the x axis is given by
$$\begin{bmatrix}1 & 0 & 0 \\ 0 & cos(\gamma) & -sin(\gamma)\\0 & sin(\gamma) & cos(\gamma)\end{bmatrix}$$

A rotation of "Yaw of α about z axis, β is pitch about y axis and γ is roll about x axis" is given by the product of those three matrice and the combination of two such rotations is the product of the two rotation matrices or of all six matrices.

4. May 15, 2014

### D H

Staff Emeritus
Halls, I fixed the math in your post.

abubakr, there are different conventions regarding which sine term in those matrices Halls posted is negated and the order in which the matrices are multiplied. If you want a combined yaw, pitch, roll sequence that is equivalent to your pair of yaw, pitch, roll sequence, there are algorithms to go from a matrix back to an Euler sequence. They are non-trivial and messy.

5. May 15, 2014

### abubakr

Thanks for answering.Halls, I exactly followed the sequence and I have check it for different values and changing order etc but its not the same.

I would like to ask (1) Is there any relationship between the final answer and initial angle values i-e if not addition then what? (2) Can we use Euler angle or Quaternion (Having no idea) or any other coordinate transformation, so that the final answer is simple addition of the angle. (I suspect that after first set of rotation,the second set of rotation apply to the 1st rotation rather than initial point.That is why they are not simply added).(3) Is it possible to apply Yaw of α about z axis and then β is pitch about y axis but the y-axis is not transformed from 1st rotation etc.