I know a matrix [x scale, y skew, x skew, y scale, trans x, trans y], and would like to get the angle in degrees.
thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Consider the following matrix
with
skindicating skew,scindicating scale andtrindicating translation.This only represents a pure rotation if all three are true
In this case, if
thetais the angle of rotation, thenThis will give you the answer in radians (most likely), so you’ll need to convert to degrees.
Assuming you have an object called M, representing the matrix, the properties that match my definitions above, you could do:
EDIT
For a pure rotation followed by (or preceded by) a scaling transform that maintains aspect ratio:
Then you can us the following identity:
This gives us
If you want to factor in translations, you’re entering a world of hurt.