I am working with some SVG files, and I would like to know how to differentiate a simple rotation, from a flip PLUS a rotation.
What I know :
example matrix :
transform="matrix(a,b,c,d,e,f)" Theorical
transform="matrix(1.866 0 -0 1.866 91.480 278.480)" Practical
We can determinate the flip of an element in this matrix by looking at the elements "a" and "d". A negative "a" means an horizontal flip and a negative "d" means a vertical flip.
My troubles arrive when I do a flip PLUS a rotation. The fact is that when I do a simple rotation, "a" and "d" can be negative too ! So how can we determinate if we have only a flip, or only a rotation, or a rotation PLUS a flip ?
Here is a matrix of an element on which I did a simple horizontal flip :
transform="matrix(-2.150 -0.012 -0.012 2.150 252.235 43.335)"
"a" element(-2.150) is negative.
Here is a matrix of an element on which I did a rotation of 135 degrees anti clockwise :
transform="matrix(-1.560 -1.479 1.479 -1.560 245.655 46.646)"
"a" element(-1.560) is negative too, but it is a simple rotation with no flip.
Here is a matrix of an element on which I did a horizontal flip PLUS a rotation of 135 degrees anti clockwise :
transform="matrix(1.674 -1.349 -1.349 -1.674 238.428 45.969)"
"a" element(1.674) is positive dispite of the flip.
Do you know a method with which I could always know if there is a simple rotation, or a simple flip, or a rotation PLUS a flip ?
If I am not clear enough, do not hesitate to ask me for more details.