[cairo] Questions and optimizations in cairo-arc

Jason Dorje Short jdorje at users.sf.net
Tue Jul 26 14:05:27 PDT 2005


Carl Worth wrote:
> On Tue, 26 Jul 2005 06:42:27 -0400 (EDT), Behdad Esfahbod wrote:

>>/* XXX: NYI
>>void
>>cairo_arc_to (cairo_t *cr,
>>              double x1, double y1,
>>              double x2, double y2,
>>              double radius);
>>*/
> 
> 
> This comes from PostScript's arct operator. The two points actually
> form two tangent lines---one from the current point to (x1,y1) and one
> from (x1,y1) to (x2,y2). These are not points on the spline at all.
> 
> See the PostScript Language Reference Manual for a more detailed
> explanation.

That is very unintuitive since in most cases neither the current nor
final (x2,y2) point will be on the arc (and of course the tangent point
(x1,y1) won't be on the arc except in degenerate cases).  This at least
needs some heavy commenting.

See http://www-cdf.fnal.gov/offline/PostScript/PLRM2.pdf - see pages
366-367 of the book (p. 372-373 of the PDF).

And couldn't it be generalized as an arc of an oval?  Three points
define two tangent vectors which define an oval, although allowing four
points makes it easier to define the two tangent vectors.

-jason



More information about the cairo mailing list