[cairo] composites circle

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Mon Jan 18 19:48:49 PST 2016


On Sun, 17 Jan 2016 10:58:06 +0100, Uli Schlachter wrote:

> #include <cairo.h>
> #include <math.h>
> 
> #define WIDTH 75
> #define HEIGHT 170
> 
> static void circle(cairo_t *cr, double xc, double yc, double radius)
> {
> 	cairo_arc(cr, xc, yc, radius, 0, 2 * M_PI);
> }
> [etc]

Just a note that M_PI is not a part of standard C. You need to prefix
the include of math.h with

    #define _XOPEN_SOURCE 500

to ensure it is defined.


More information about the cairo mailing list