1

Considering a cube which is along $x,y,z$ axes, $y$ being parallel with gravity, at its "resting" point, $x$ and $z$ will be running at 90 degrees relative to gravity, and $y$ will be $0$ (parallel).

enter image description here

If I rotate this cube 30 degrees around the $z$ axis, those angles will now be: $x: 60, y: 30, z: 90$. Simple calculation...

enter image description here

My question is, if I then perform another rotation through a different axis, how do I now calculate these angles? My basic trigonometry is ok but I don't even know where to start with 3D geometry.

enter image description here

Chris A
  • 113

1 Answers1

1

First, let's vectorize our points: x = (1, 0, 0); y = (0, 1, 0); z = (0, 0, 1); The force of gravity is (0, 1, 0) = g; As @Aretino points out, we can use the 3D rotation matrices. So, if we want to rotate a degrees around the x-axis, b degrees around the y-axis, and c degrees around the z-axis, we can do the following: x * Rx(a) = x' //note here x' is not a derivative but the new value of the vector x. x' * Ry(b) = x'' x'' * Rz(c) = x''' Now we can take the dot product of x''' * g = |x'''| * |g| * cos(theta). Divide the dot product by the product of both vector's lengths. Then take the arccos of that and you will get the angle in-between the two vectors. You can repeat this process for the y and z vectors. Hope this helps.

  • Please consider using MathJax. – Matt Samuel Jul 17 '20 at 20:12
  • @Matthew B, I think I understand the basic gist of how you're arriving at the answer, but I don't really understand what $Ry(a)$ is, nor what $x'''$ is with respect to $|x'''|$ – Chris A Jul 17 '20 at 22:16
  • @ChrisA Ry(a) is the 3D rotation matrix for rotating about the y-axis ( https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations ). x''' is a vector. The dot product of two vectors (x''' and g) is equal to the length of each vector (|x'''|, |g|) times the cosine of the angle between each vector, cos(a) in this case. In this case, x', x'', and x''' are the same vector as x but in a different coordinate system. – Matthew B. Jul 19 '20 at 18:16
  • OK, @MatthewB, it looks like I need to do some reading on rotation matrices. Tentatively accepting this answer :) – Chris A Jul 20 '20 at 10:16