    /* The following are for implementing the Guibas algorithm */

/* state list representation */

typedef float real;

typedef struct _pstate *pstate;

#define TYPE_MOVE               1
#define TYPE_TURN               2


#define PI 3.1415926535897
#define TWOPI (PI * 2.0)

#define x_coordinate(p) (p->x)
#define y_coordinate(p) (p->y)

struct _pstate {
    int type;			/* turn or move */
    point *p;			/* x, y coordinates */
    real min, max;		/* in case of move this is dx, dy */
    pstate next;
    pstate prev;
};

typedef struct _point_list {
  point *p;
  struct _point_list *next;
  struct _point_list *prev;      /* needed? */
} point_list;

polygonal *cspace_poly();
real atan2pi();
point *first_crossing();
point_list *my_point_add();
polygonal *point_list_to_polygonal();
point_list *ensure_simple_polygon_aux();
polygonal *ensure_simple_polygon();


