Solve a system of rotation matrices z-x-z == z-x-y

64 Views Asked by At

I have the following equation I would like to solve (I'm looking for: r1, s2 and s3):

rotz(-r1) * rotx(90 + s2) * rotz(s3) = rotz(-alpha) * rotx(beta) * roty(gamma)

where:
- rotx(), roty() and rotz() are respectively rotation matrices around x, y and z-axis of a given angle in degrees.
- alpha, beta and gamma are known.

I also tried to solve it with quaternions but without success.
Have you any advice or solution to this problem?

1

There are 1 best solutions below

0
On

Finally I managed it with quaternions by using:

qin = angle2quat(alpha, beta, gamma, 'ZXY')
[r1, s2, s3] = quat2angle(qin, 'ZXZ')

with matlab. (alpha, beta, gamma, r1, s2 and s3 are in radians here)

Just to show what the result looks like after simplification:

r1 = -atan2((cos(alpha)*sin(gamma) - cos(gamma)*sin(alpha)*sin(beta)),(sin(alpha)*sin(gamma) + cos(alpha)*cos(gamma)*sin(beta)))
s2 = acos(cos(beta)*cos(gamma))
s3 = atan2(-cos(beta)*sin(gamma), sin(beta))