Question: fsolve more equations than variables

Hi everyone,

 

i'm trying to find out the euler angles from a rotation matrix.

I have a matrix that contains the result of multpilying the 3 axis rotation R(z,c)*R(y,b)*R(x,a) without knowing the values of the angles a,c,b (that's what I want to find out), so there are sinus and cosinus everywhere. There is another matrix containing the expected values that each equation in the first matrix will match.

My problem is that I eventually will change the order of the multiplication of the axis (i.e. R(x,a)*R(z,c)*R(y,b)) and I'm try to make maple compute this for me.

I defined R(x,a), R(y,b) and R(z,c) as follows:

Rx := Matrix (3,3, [1,0,0,0,cos(a),-sin(a),0,sin(a),cos(a)]);    
Ry := Matrix (3,3, [sin(b), 0, cos(b), 0, 1, 0, -sin(b), 0, cos(b)]);
Rz := Matrix (3,3, [cos(c), -sin(c), 0, sin(c), cos(c), 0, 0, 0, 1]);
and
RT := Multiply(Multiply(Rx,Rz),Ry);

Since here is alright. Now I want to match RT to the solution matrix.

g1 := RT[1,1] = mat[1,1];
g2 := RT[1,2] = mat[1,2];
g3 := RT[1,3] = mat[1,3];
g4 := RT[2,1] = mat[2,1];
g5 := RT[2,2] = mat[2,2];
g6 := RT[2,3] = mat[2,3];
g7 := RT[3,1] = mat[3,1];
g8 := RT[3,2] = mat[3,2];
g9 := RT[3,3] = mat[3,3];

soll := fsolve({g1,g2,g3,g4,g5,g6,g7,g8,g9},{a,b,c});

At this point I'm getting an error. I know that there are more equations than variables but the system is solvable anyway.
What maple trick can I do to solve this system or to find the good 3 equations?

 

Extra question:

Is there any method to match RT to mat without all those gX equations?

 

Thank you everyone.

Please Wait...