[cairo] Two usage questions( matrix and fill with dash stroke)

Bill Spitzak spitzak at thefoundry.co.uk
Wed Apr 9 11:53:14 PDT 2008


Behdad Esfahbod wrote:
> On Wed, 2008-04-09 at 14:00 -0400, Bill Spitzak wrote:
> 
>> If the determinant (m.xx*m.yy-m.yx*m.xy) is zero then it is a
>> degenerate 
>> transform which transforms everything to a point or a line and the
>> above 
>> results are garbage. It is best to skip these. You may be tempted to 
>> think you can figure out the rotation of the line but I have found
>> that 
>> to be much harder than it looks.
> 
> Humm, why?  Take any three non-colinear points, say (0,0), (1,0), (0,1),
> transform them.  If they are all equal, matrix is a 0-rank degenerate
> one that maps all points to that single point.  Otherwise you have at
> least two different points in the range space, use them to find the
> angle of the line.

I think you are right. I first thought that at least one of the scale 
factors would be zero, but I had examples where that was not true, and 
got confused after that.

I think in fact if both scales are zero then it is a single point (at 
the tx,ty values).

If one of the scales is zero then the other rotation is correct.

If both scales are non-zero then the rotations indicate the angle of the 
line but there is also "shear" involved which I kind of ignored anyway.


More information about the cairo mailing list