A matrix is an affine transformation in the form [a,b,c,d,tx,ty]
. If you parse the css string into an object with those properties (respectively [0,1,-1,0,0,0]
in your example), then you can calculate the angle of rotation in degrees by doing: Math.atan2(matrix.b,matrix.a) * (180 / Math.PI);
There's a good article on the css matrix here http://dev.opera.com/articles/view/understanding-the-css-transforms-matrix/ - but still the best explanation I've found is this one by Senocular (even though it's meant to be about Flash, the basic math is the same): http://www.senocular.com/flash/tutorials/transformmatrix/
The rotate(deg)
syntax is just a shorthand for the underlying matrix transform. I'm not sure why FF accepts one format, but reports another.
More on transforms: http://www.w3.org/TR/2012/WD-css3-transforms-20120911/