# Composition of Euler angles

I have a problem in which I apply a sequence of $$N$$ rotations, each one of different angles $$\theta_1,...,\theta_N$$. But my angle here are associated to rotations around either $$x$$ or $$y$$ axis in the following form:

$$R=R_y(\theta_N)R_x(\theta_{N-1})...R_x(\theta_2)R_y(\theta_1)$$. In a way it is a composition of rotations specified by Euler angle around the system of axis $$yxy$$.

My question is the following:

From what I read, composition of $$N$$ rotations around arbitrary axes is a very complicated problem to obtain "nice" analytic formulas. However, here I use as "basis" of rotations $$x$$ and $$y$$ axis. In this particular case, are there some method to know what would be the Euler angle around those same axes $$xyx$$ (having "nice" analytical formulas) ?

Said differently, given two rotations specified by their Euler angles, is there a nice formula to have the Euler angles of the resulting rotation ?

Not directly (or at least I don't know about a nice formula). But if you get the rotation matrix $$R$$, you can immediately calculate some Euler angles that will give you the same rotation matrix. Note that the answer might not be unique. Also note that you must specify which convention you want to use for your Euler angles. From the matrices provided in the link above, you can calculate the angles. For example, assuming that you have the $$YXY$$ convention, and indexing $$R$$ from $$1$$ to $$3$$, you get $$\cos\beta=R_{22}$$. If $$\sin\beta\ne 0$$, then you can use $$\alpha=\textrm{atan2}(R_{12},R_{32})\\\gamma=\textrm{atan2}(R_{21},-R_{23})$$ Note that if $$\sin\beta=0$$, then you have a degenerate case, a rotation purely around the $$Y$$ axis, with an angle say $$\delta$$, and you can have any $$\alpha$$ and $$\gamma$$ as long as $$\alpha+\gamma=\delta$$