Euler angle rotation

From the three-dimensional Cartesian coordinate, the coordinate of the object A can be expressed as xyzwpr (green arrow). And from the Coordinate World object, object B can also be expressed as xyzwpr (blue arrow).

Then can someone write C # code to calculate xyzwpr of object B relative to the original coordinate system (red arrow)?

Say that the coordinate is (30,50,70, -15,44, -80) B (60,90,110, 33,150, -90).

And let's say that the rotation order is yaw (z) → pitch (x) → roll (y)

rotation

--- EDIT ---

Can anyone confirm valid assumptions?

Assumption for xyz point B.

xyz of point B, a smaller plane, can be calculated by adding xyz of point A, the first plane and xyz from B, and then applying 3d rotation A wpr to A xyz.

The order of doing this:

1) A ( A, -Ax, -Ay, -Az)

2) ( 3 × 3 R0 A)

3), . ( A, + Ax, + Ay, + Az)

wpr B . AwApArBwBpBr.

--- . ---

VS

+3
1

.

-, , . , , , .

. : " - , ?".

? , , , , , 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.

+2

All Articles