<p dir="ltr">On Dec 14, 2015 10:30 PM, "Arjen Nienhuis" <<a href="mailto:a.g.nienhuis@gmail.com">a.g.nienhuis@gmail.com</a>> wrote:<br>
><br>
> > Yeah... You have to define what exactly you want.  A 2D matrix like the ones<br>
> > cairo uses can always be decomposed into a concatenation of the following<br>
> > matrices:<br>
> ><br>
> >   - transform<br>
><br>
> transform is what cairo calls translate right?</p>
<p dir="ltr">Err.  Yes, I meant translate.<br></p>
<p dir="ltr">> >   - rotate<br>
> >   - skew<br>
> >   - scale<br>
> ><br>
> > This has many useful properties, and you can derive those four transformations<br>
> > from an arbitrary matrix easily.  Here's my derivation:<br>
> ><br>
> > <a href="https://readable-email.org/list/www-style/topic/better-matrix-decomposition-for-animation">https://readable-email.org/list/www-style/topic/better-matrix-decomposition-for-animation</a><br>
> ><br>
> > This also describes the benefits of such decompositions:<br>
> ><br>
> > <a href="http://research.cs.wisc.edu/graphics/Courses/838-s2002/Papers/polar-decomp.pdf">http://research.cs.wisc.edu/graphics/Courses/838-s2002/Papers/polar-decomp.pdf</a><br>
> ><br>
> > If you transform a circle with a matrix, you get an ellipse.  If you are<br>
> > interested in the major and minor axes of that ellipse, that's a Singular<br>
> > Value Decomposition of the 2D matrix.  I've put code here for doing that:<br>
> ><br>
> > <a href="https://github.com/behdad/cairo/blob/color-emoji/doc/tutorial/src/singular.c">https://github.com/behdad/cairo/blob/color-emoji/doc/tutorial/src/singular.c</a><br>
> ><br>
> > Cheers,<br>
> ><br>
> > behdad<br>
> > --<br>
> > cairo mailing list<br>
> > <a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
> > <a href="http://lists.cairographics.org/mailman/listinfo/cairo">http://lists.cairographics.org/mailman/listinfo/cairo</a><br>
</p>