[cairo] Adding cairo_shear and family
Behdad Esfahbod
behdad at behdad.org
Tue Jan 20 13:14:57 PST 2009
Bill Spitzak wrote:
> 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].
Well, yeah. That's the other thing I was thinking about: maybe we don't need
cairo_shear() afterall?
behdad
More information about the cairo
mailing list