I am trying to find a solution to a problem such that
Given an initial coordinate system comprised of 3 orthogonal axes X, Y, Z, where Z is up, Y is North and X is East.
Given a rotation definition (A) which describes successive rotations about each axes.
Given the rotation angles for each axes produce a rotated coordinate system.
For a rotation definition (B) which describes successive rotations about each axes, find the rotation angles that produce the same coordinate system as produced by rotation definition A.
For example:
If rotation definition A is defined by 3 successive rotations around Z, then Y and then X, all defined positive counter-clockwise from East to North, i.e. (+Z +Y +X), and whose angles are bounded by -180 and + 180 degrees.
And if rotation definition B is defined by 3 successive rotations around Z, then X, and then Z again, the first rotation being defined positive clockwise from North to East (i.e. Azimuth or A), the second one positive counter-clockwise from East to North and the third one positive clockwise from East to North, i.e. (A +X, -Z). The first rotation angles are bounded by 0 to 360 degrees, while the second and third are bounded by -180 to + 180 degrees.
Find the rotation angles for definition B that produce the same result as definition A.
I am hoping to utilise a general algorithm into which I input the two rotation definitions and angles for the first definition.
I hope my description makes sense. I have included some images to help visualise the problem.
The first image shows rotation definition A with angles 90, 10 and 20 and a visualisation of a 3D reference plane produced by the rotations.
The second image shows rotation definition B with the angles required to produce the same 3D reference plane. It is these angles I wish to calculate.
Thanks in advance.