Strange rotation

Simple mesh of two vertices vith coordinates (0, 0, 0) and (0, 0, 1) is rotated -20 degrees along X axis and 20 degrees along Y axis. I expected to get steady 45 degrees line on top view, but instead:

Rotation bug.blend (704 KB)
Or do I misunderstand something about the geometry? X and Y coordinates of pick’s vertice are different. Near, but different (0.3213939, 0.3420203, 0,8830221). This causes serious problems on my more complicated model of Rubik’s cube. Its details should be symmetric in all directions, but instead resulting meshes are wry.

I’m not 100% sure of what you’re asking, but if you want the vector formed by the two vertices to have its origin at the centre of the cube and vector through the corner of the cube, x=35 degrees and y=45 degrees. I don’t know why; I’m not a mathematician. Maybe it’s some sort of bug.

Oh, and do it in object mode, not edit mode.

This is exactly how the rotation is supposed to work, and you can check it by manually calculating the position of the vertex you move.

First they Y-value, since it doesn’t change after the first rotation
Y = 1 * Sin[20°] = 0.3420. Correct!

Rotating around the Y axis is now a bit more difficult.
Before the second rotation, the Z value of the vertex is 1 * Cos[20°] = 0.9397

So when rotating around the Y-axis, the final posision on the X-axis becomes:
1 * Cos[20°] * Sin[20°] = 0.3214. Correct!

And similarly the final Z-value becomes
1 * Cos[20°] * Cos[20°] = 0.8830. Correct!

Now if we redefine the angles, and write them as 90 - 20 = 70, the formulas become
Y = 1 * Cos[70]
X = 1 * Sin[70°] * Cos[70°]
Z = 1 * Sin[70°] * Sin [70°]
This is simply the transformation from spherical coordinates to cartesian coordinates (although the coordinate system is rotated)

I asked such question because I needed to create sectors of sphere as parts of this:

First I tryed to use screw and boolean modifiers, but meshes formed by screw had open holes on its ends, so boolean couldn’t be calculated. I figured out why “strange rotation” happened, and your explanations helped too. Now this model of 6x6x6 Rubik’s cube is just bunch of manually rotated vertices. The result is not perfect, but ok for now.