# The calculation of rotation angles between two coordinate systems

There is a three-dimensional orthogonal coordinate system (OXYZ). There is another orthogonal coordinate system (OX''z`) rotated relative to the first unknown angles. The centers of the coordinate systems coincide. In the coordinate system (OXYZ) we know the coordinates of the vector OX` and the vector OZ`. You need to find the rotation matrix for going from coordinate system (OXYZ) to (OX''z`). Help, and the whole brain itself broke. Or prompt in what side to dig.
October 3rd 19 at 03:17
October 3rd 19 at 03:19
Solution

If the coordinates in XYZ
OX' = (x1, y1, z1)
OY' = (x2, y2, z2)
OZ' = (x3, y3, z3)
The transformation matrix from XYZ to X'y'z`
x1, x2, x3
y1, y2, y3
z1, z2, z3

In fact , almost by definition
Will be a matrix transformation from X'y'z` to XYZ. But according to the problem, only the known coordinates of the axes OX' and OZ'. Coordinates OY' is not known. - Phyllis.Cronin commented on October 3rd 19 at 03:22
But still thanks, you can try to calculate the coordinates of the third axis, as the solution turns to a combination of axes gave a huge resulting rotation matrix. - Phyllis.Cronin commented on October 3rd 19 at 03:25
coordinates 3rd axis is the cross product of the first two - helga.Johns commented on October 3rd 19 at 03:28
October 3rd 19 at 03:21
Sorry if I'm wrong, but you will have two rotation matrix. The X-axis and around the axis Y. Here they are:

Around X:

Around The Y:

Well, to find corners it is simple:

After all, you have the coordinates to OX` and OY` in the source system.
the idea is, if the transition matrix to convert for example the OX axis then it must coincide with the axis OX'. how to do it without rotating around the axis OZ I have no idea. In my understanding it should be at least 3 turns. - Phyllis.Cronin commented on October 3rd 19 at 03:24
Rotate on two axes will rotate the on third the only way. - Phyllis.Cronin commented on October 3rd 19 at 03:27
Well, just do not understand the rotation angles Phi and psi between what and what? Personally I find them not as elementary as you and I do not understand what the formula you gave. - helga.Johns commented on October 3rd 19 at 03:30
The angle Phi is the angle between the vectors OX and OX`, the angle psi is the angle between OY and OY`. What would they find necessary to substitute the corresponding vectors in the formula and calculate the arc cosine of what is going to happen. - Phyllis.Cronin commented on October 3rd 19 at 03:33
now it is clear. Yet that's just in the first message you write on the rotation around the X axis and y axis And if the angle Phi is the angle between the vectors OX and OX` that we need to rotate all around OY' for combining OX and OX`. Let us denote this new rotated system as the OX"Y"Z". to align the axes OY and OY" calculate the angle between them and rotate around OX axis", it also OX'. So? - leanna_Legr commented on October 3rd 19 at 03:36
October 3rd 19 at 03:23
Yes, a William Hamilton, too, was racking my brain, along with colleagues. However, not about that. But they did that and we also will be useful: ru.wikipedia.org/wiki/%D0%9A%D0%B2%D0%B0%D1%82%D0%B5%D1%80%D0%BD%D0%B8%D0%BE%D0%BD%D1%8B_%D0%B8_%D0%B2%D1%80%D0%B0%D1%89%D0%B5%D0%BD%D0%B8%D0%B5_%D0%BF%D1%80%D0%BE%D1%81%D1%82%D1%80%D0%B0%D0%BD%D1%81%D1%82%D0%B2%D0%B0
What is the quaternion I know. The problem is not to rotate, and to determine the axis of rotation and the angles that need to rotate. - Phyllis.Cronin commented on October 3rd 19 at 03:26
We rotate the coordinate system first so that the matched OX' C OX, while OY' goes to, say, OY". Then turned the system turn the second time (around OX') to OY" coincided with OY. (At the first turn of the rotation axis with the cross product of the OX' and OX, and the angle of rotation in both cases is through a scalar, the formula already cited above.) Both Express the rotation quaternion, and then of their composition and get the axis and angle. - Phyllis.Cronin commented on October 3rd 19 at 03:29
as we are expecting the transition from the system OXYZ to OX''z' respectively, offer dovorachivat OXYZ to OX''z' and not Vice versa. So in the beginning according to the formula calculate the angle between OX and OX' and povorachivat axis OY'. we will match OX', and OX Turned obzovem system OX"Y"Z". Now to combine OY' and OY" find the angle between them and pivoted along the axis OX", aka the OX'. So? - helga.Johns commented on October 3rd 19 at 03:32
Yes, that's right — take the second turn to do around that vector, which is already combined. But to combine his first turn, the cross-product to calculate in the General case, is still needed. And use this cross product as the axis of rotation for the first turn. Is that, in the conditions of the problem, OY' is perpendicular to the plane XOX'?
PS: Accidentally changed the notation compared to those that were in question. In the question — the vectors OX' and OZ', and I — OX' and OY'. - Phyllis.Cronin commented on October 3rd 19 at 03:35
October 3rd 19 at 03:25
As far as I can recall, if we take the coordinates of the unit vectors of the new system, placed in the old, these coordinates are the rows of the desired matrix.
Exactly lines? Suppose that a new coordinate system differs from the old only by a rotation around the y axis 45 degrees. then, if according to your words the rotation matrix takes the form:
0.7, 0, 0.7
0, 0, 0
-0.7, 0, 0.7

multiply this matrix by the vector OX
1
0
0

and get the vector with coordinates 0.7, 0, -0.7. A were 0.7, 0, 0.7. - Phyllis.Cronin commented on October 3rd 19 at 03:28
So columns depend on the entry form. I had to deal with both variants, so I was not oriented that is required for the classic version. By the way, the second vector will be (0, 1, 0). - Phyllis.Cronin commented on October 3rd 19 at 03:31
October 3rd 19 at 03:27
Here is the detail and accessible language describes the use of Euler angles, matrices and quaternions: www.rossprogrammproduct.com/translations/Matrix%20and%20Quaternion%20FAQ.htm
October 3rd 19 at 03:29