[cairo] Extracting The Scaling Component Of A Matrix

Behdad Esfahbod behdad at behdad.org
Tue Dec 15 00:39:02 PST 2015


On Dec 14, 2015 10:30 PM, "Arjen Nienhuis" <a.g.nienhuis at gmail.com> wrote:
>
> > Yeah... You have to define what exactly you want.  A 2D matrix like the
ones
> > cairo uses can always be decomposed into a concatenation of the
following
> > matrices:
> >
> >   - transform
>
> transform is what cairo calls translate right?

Err.  Yes, I meant translate.

> >   - rotate
> >   - skew
> >   - scale
> >
> > This has many useful properties, and you can derive those four
transformations
> > from an arbitrary matrix easily.  Here's my derivation:
> >
> >
https://readable-email.org/list/www-style/topic/better-matrix-decomposition-for-animation
> >
> > This also describes the benefits of such decompositions:
> >
> >
http://research.cs.wisc.edu/graphics/Courses/838-s2002/Papers/polar-decomp.pdf
> >
> > If you transform a circle with a matrix, you get an ellipse.  If you are
> > interested in the major and minor axes of that ellipse, that's a
Singular
> > Value Decomposition of the 2D matrix.  I've put code here for doing
that:
> >
> >
https://github.com/behdad/cairo/blob/color-emoji/doc/tutorial/src/singular.c
> >
> > Cheers,
> >
> > behdad
> > --
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20151215/e4d65326/attachment.html>


More information about the cairo mailing list