[cairo] Cairo transformations. Old bug that has been solved?

Dov Grobgeld dov.grobgeld at gmail.com
Sun Oct 9 12:05:51 PDT 2011


Thanks Behdad! I knew it was was something simple that I missed.

Dov

On Sun, Oct 9, 2011 at 20:23, Behdad Esfahbod <behdad at behdad.org> wrote:

> On 10/09/11 11:21, Dov Grobgeld wrote:
> >     return np.matrix([[c[0],c[1],c[4]], [c[2],c[3],c[5]], [0,0,1]])
>
> This is wrong.  From cairo docs:
>
>  * @xx: xx component of the affine transformation
>  * @yx: yx component of the affine transformation
>  * @xy: xy component of the affine transformation
>  * @yy: yy component of the affine transformation
>  * @x0: X translation component of the affine transformation
>  * @y0: Y translation component of the affine transformation
>
>  * <programlisting>
>  *     x_new = xx * x + xy * y + x0;
>  *     y_new = yx * x + yy * y + y0;
>  * </programlisting>
>
> So, it only makes sense that xx, xy, and x0 go on the first row, that is,
> c0,
> c2, c4.  You are doing c0, c1, c4.
>
> behdad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20111009/83d75744/attachment.htm>


More information about the cairo mailing list