Computing Euler angles from rotation matrix: boundary cases
<p>I want to compute the <strong>Euler angles</strong> from a rotation matrix in order to find out the orientation associated to that rotation. For that purpose, I am using MATLAB and the function <strong>rotm2eul</strong> that gives me the rotation first about x-axis, then about y-axis and finally the z-axis. </p>

<p>I am using a signal with 1000 frames and for each frame a rotation matrix is computed, as well, the three Euler angles. However, when I am going to see the Euler angles' curve, there is some "<strong>jumps</strong>" as I shown on the figures below. </p>

<p><a href="https://i.stack.imgur.com/al1hf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/al1hf.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/E22Gg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E22Gg.png" alt="enter image description here"></a></p>

<p>On Technique 1, I think it jumps from -180º to 180º which should be the same. In fact, the upper portion of the plot seems a continuation of the lower portion. So in this case I thought I could <strong>subtract 360º</strong> to the upper portion to get the plot. But I am not sure if I do this I am <strong>falsifying the results</strong>.</p>

<p>On Technique 2, it makes a jump with a different reason of the previous one. I think it must be because the angle associated with the y-axis <strong>reaches 90º</strong> which should be a boundary case. But in this case I don't know how should I correct the data or , like previously, if I want to correct the plot is falsifying the euler angle result.  </p>