.
-, , . , , , .
. : " - , ?".
? , , , , , atan2.
, , , atan2 ( ), ():
Matrix c = a;
Matrix yaw, pitch, roll;
Matrix pos;
buildTranslationMatrix(pos, x, y, z);
buildRotationZMatrix(yaw, w);
buildRotationXMatrix(pitch, p);
buildRotationYMatrix(roll, r);
mult (c, c, pos); //c = c*pos
mult (c, c, yaw); //c = c*yaw
mult (c, c, pitch);
mult (c, c, roll);
decomposePos(c, x, y, z); // obtain final xyz from c
decomposeAngles(c, w, p, r); // obtain final wpr from c
-.
, .:)
.
, , , . , ( ), :
xyz ( wpr), , . :
M = TA * RA * TB * RB
(TA - A RA - )
:
r r r t
r r r t
M = r r r t
s s s w
. TA*RA:
1 0 0 x r r r 0 r r r x
0 1 0 y r r r 0 r r r y
0 0 1 z * r r r 0 = r r r z
0 0 0 1 0 0 0 1 0 0 0 1
A. , , , , x, y, z. - , . , -, .
, ,
M = (TA * RA) * (TB * RB)
M = ((TA * RA) * TB) * RB
xyz M, wpr 3 * 3 M.