#define PI 3.1415926535897
#define SCALE 10*PI
#define measure(a,b) (PI*a*b)

typedef struct ellipse ellipse;
struct ellipse{
  coord f1;
  coord f2;
};

enum{
  RESOLUTION = 20
    };

void calc_p(point *points,     /* Calculate p\_max and p\_min */
	    point *nextpoint,  /* for new point `nextpoint' */
	    double gamma1,     /* and existing points in `points' */
	    double gamma2,
	    double a1,
	    double a2,
	    double b1,
	    double b2,
	    double *p_max,
	    double *p_min
	    );

void count(point *p,void *arg);   /* Use with applyinorder to count */
                                  /* points */

void count_min(point *p,void *arg);    /* Use with applyinorder to */
                                       /* count points in the */
                                       /* minimum process */

void makeellipse(point *p, /* Point about which to centre ellipse */
		 ellipse *e, /* Address of ellipse to centre at p */
		 double a,   /* Length of semi-x axis */
		 double b);  /* Length of semi-y axis */

/* Returns amount of extra area resulting from the addition of 
   new point */
double extra(ellipse *new,  /* Ellipse centred at new point */
	     ellipse old[], /* Array of ellipses centred at */
			    /* existing points */
	     int n_old,
	     double a,      /* Length of semi-x axis */
	     double b);     /* Length of semi-y axis */

/* Return value of 0 means that the outer rectangles of the 
   ellipses passed were non-overlapping */
int overlap(ellipse *A,
	    ellipse *B,
	    ellipse *OL,
	    double a,
	    double b);
