views:

20

answers:

1

I have transformation matrix properties (a,b,c,d). How to calculate scaleX, scaleY, scewX, scewY and rotation angle from those values?

When only one type of transformation is applied, I can figure out that:

scaleX = a
scaleY = d
scewX = c
scewY = b
rotation = arccos(a) or -arcsin(c)

But when multiple transformations are applied at once I don't know how to calculate those values.

I need to do this outside of flash so I can't use any flash helper methods.

Thanks.

+2  A: 

Check out this tutorial:

http://www.senocular.com/flash/tutorials/transformmatrix/

It explains everything you need to know about transformation matrices in Flash pretty well. It says Flash 8, but everything discussed there applies to more recent versions as well.

The section "Transformation Conversions" covers what you are after.

Claus Wahlers
Thanks. It answers almost all questions except how to calculate `deltaTransformPoint` which they are using to get skew and rotation (I will be doing it outside of flash so I don't have this method).
serg
deltaTransformPoint simply multiplies the matrix with the point (with tx and ty set to 0). You should be able to implement that easily on the platform of your choice. It's basic vector math, nothing Flash specific really.
Claus Wahlers