Click here to Skip to main content
16,004,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I've worked on this problem for 3 days and I've decided to reach out for help.
I have a rectangle and I know its width and height. After the rectangle is rotated in 3D space, I know all 4 corners 2D points (see link).

Link to image showing problem

What I need to figure out what the 3 angles that it was rotated are.

What I have tried:

I tried a projective transformation which worked when the rectangle is rotated only in the Z direction. But fails when the rectangle is rotated in multiple directions (see link)
Posted
Updated 16-Aug-24 6:41am
v3

1 solution

If I understood your request correctly...

1.) You know the four points of the original rectangle:
A, B, C, D (where I assume the Z component is always 0)

2.) You know the four points of the rotated rectangle (in 3D space):
A', B', C', D'

3.) I assume, you know the rotation matrices for 3D Spaces
E.g. Rotation matrix - Wikipedia[^]

4.) You are looking for the three rotation angles α, β, γ.
Now we can write down all the equations (based on the rotation matrices) that needs to be fulfilled for the above and you will recognize there will be much more equations, then the variables you are looking for.

Conclusion: That means, there will be no unique solution.
In other words: an infinite number of combinations of angles α, β, γ will give a solution

Btw:
I'm always fascinated by linear algebra but I'm far from being a professional here.
@Stefan63 (Stefan_Lang - Professional Profile[^]) can explain this much better and also provide the mathematical conclusions/proofs ;)
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900