Problem 44895. Determine roll pitch yaw angles from a 3D rotation matrix
Solution Stats
Problem Comments
-
2 Comments
There is a flaw in the test suite. It tests the values in rpy2r rather than the results rpy from the solver's function. Also, the tolerance needs to be widened a bit.
Actually that's not a flaw, William. Since it is not always possible to determine the exact three original angles. In the second test case for instance, there are infinite solutions due to a singularity. Therefore, he tests the rotation matrix since it will be equal for all possible solutions.
Solution Comments
-
1 Comment
It's interesting that a precision error allows you to recover the original angles: atan2(cos(pi/2)*sin(pi/3),cos(pi/2)*cos(pi/3)) amazingly returns pi/3, which obviously should not be true since atan2(0,0) = 0 (?). The issue seems to be that cos(pi/2) is not zero (due to an approximation error), but just a really small value close to zero.
Problem Recent Solvers5
Suggested Problems
-
3941 Solvers
-
Smallest distance between a point and a rectangle
163 Solvers
-
Is this date a palindrome?emordnilap a etad siht sI
58 Solvers
-
Get an array of month-ends in a date range
61 Solvers
-
Operate on matrices of unequal, yet similar, size
130 Solvers
More from this Author16
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!