Index: ChangeLog =================================================================== RCS file: /cvs/cairo/cairo/ChangeLog,v retrieving revision 1.942 diff -u -r1.942 ChangeLog --- ChangeLog 22 Aug 2005 22:49:04 -0000 1.942 +++ ChangeLog 22 Aug 2005 23:20:49 -0000 @@ -1,3 +1,9 @@ +2005-08-22 Bertram Felgenhauer + + * src/cairo-pen.c (_cairo_pen_vertices_needed): use correctly + transposed version of the matrix and fix up the comments above + to use row vector notation. + 2005-08-22 Tor Lillqvist * configure.in: Calculate LT_CURRENT_MINUS_AGE (which forms part Index: src/cairo-pen.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-pen.c,v retrieving revision 1.23 diff -u -r1.23 cairo-pen.c --- src/cairo-pen.c 7 Apr 2005 17:01:49 -0000 1.23 +++ src/cairo-pen.c 22 Aug 2005 23:20:49 -0000 @@ -192,7 +192,7 @@ 2. The question has been posed: What is the maximum expansion factor achieved by the linear transformation -X' = _R_ X +X' = X _R_ where _R_ is a real-valued 2x2 matrix with entries: @@ -246,7 +246,9 @@ Thus - X'(t) = (a*cos(t) + b*sin(t), c*cos(t) + d*sin(t)) . + X'(t) = X(t) * _R_ = X(t) * [a b] + [c d] + = (a*cos(t) + c*sin(t), b*cos(t) + d*sin(t)). Define @@ -254,22 +256,22 @@ Thus - r^2(t) = (a*cos(t) + b*sin(t))^2 + (c*cos(t) + d*sin(t))^2 - = (a^2 + c^2)*cos^2(t) + (b^2 + d^2)*sin^2(t) - + 2*(a*b + c*d)*cos(t)*sin(t) + r^2(t) = (a*cos(t) + c*sin(t))^2 + (b*cos(t) + d*sin(t))^2 + = (a^2 + b^2)*cos^2(t) + (c^2 + d^2)*sin^2(t) + + 2*(a*c + b*d)*cos(t)*sin(t) Now apply the double angle formulae (A) to (C) from above: r^2(t) = (a^2 + b^2 + c^2 + d^2)/2 - + (a^2 - b^2 + c^2 - d^2)*cos(2*t)/2 - + (a*b + c*d)*sin(2*t) + + (a^2 + b^2 - c^2 - d^2)*cos(2*t)/2 + + (a*c + b*d)*sin(2*t) = f + g*cos(u) + h*sin(u) Where f = (a^2 + b^2 + c^2 + d^2)/2 - g = (a^2 - b^2 + c^2 - d^2)/2 - h = (a*b + c*d) + g = (a^2 + b^2 - c^2 - d^2)/2 + h = (a*c + b*d) u = 2*t It is clear that MAX[ |X'| ] = sqrt(MAX[ r^2 ]). Here we determine MAX[ r^2 ] @@ -377,12 +379,12 @@ double a = matrix->xx, b = matrix->yx; double c = matrix->xy, d = matrix->yy; - double i = a*a + c*c; - double j = b*b + d*d; + double i = a*a + b*b; + double j = c*c + d*d; double f = 0.5 * (i + j); double g = 0.5 * (i - j); - double h = a*b + c*d; + double h = a*c + b*d; /* * compute major and minor axes lengths for