# [cairo] Questions and optimizations in cairo-arc

Tue Jul 26 14:37:52 PDT 2005

```On Tue, 26 Jul 2005, Jason Dorje Short wrote:

> 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,
> >>*/
> >
> >
> > 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.

>From a use-case point of view though it's quite intuitive.  It's
like drawing a line to (x1,y1) and then (x2,y2), except that it
draws a nice arc instead of the sharp edge.

> 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