[cairo] Adding cairo_shear and family
Bill Spitzak
spitzak at thefoundry.co.uk
Tue Jan 20 13:05:17 PST 2009
Behdad Esfahbod wrote:
> M Joonas Pihlaja wrote:
>
>> FWIW, I liked Bill's and Paolo's approach of an area preserving mapping
>> (this being one of the properties of a shear) and along those lines I
>> would propose using
>>
>> [1 +- sqrt(-sx*sy) sx
>> sy 1 -+ sqrt(-sx*sy)],
>
> I initially liked it too. But it's too hard to see what that's doing. The
> good thing about [1 sx sy 1] is that combined with a cairo_scale, you can map
> your two coordinates onto arbitrary vectors *easily* just by a cairo_scale and
> a cairo_shear. That's not the case with the area-preserving variant.
You can get two arbitrary vectors "easily" by putting the values right
into the matrix: [xx xy yx yy 0 0] where the vector for the x axis is
[xx xy] and the vector for the y axis is [yx yy].
--
Bill Spitzak, Senior Software Engineer
The Foundry, 618 Hampton Drive, Venice, CA, 90291, USA
Tel: +1 310 399-4555 * Fax: +1 310 450-4516 * Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027
More information about the cairo
mailing list