Find rotation angles from 3d box coordinates

235 Views Asked by At

Assume there is 3d box in a cartesian coordinates system $(x,y,z)$ such that the box edges are parallel to the axes $x,y,z$ and let's assume that one of the box corners is in the point $(0,0,0)$.

Now we rotate the 3d box using the Euler angles $\alpha, \beta, \gamma$ which are the yaw, pitch and roll angles respectively.

Then, we project the 3d box to 2d cartesian coordinates system such that $x,y$ are the same in both systems.

The problem is finding the angles $\alpha, \beta, \gamma$ given the coordinates of the box in the 2d coordinates system, i.e. given 8 corners of the box $(x_1,y_1),\ldots,(x_8,y_8)$.

I guess it is possible using the inverse of the rotation matrix and then solve the equations, but I'm looking for a simpler solution using geometry.