38 #include <cairo/cairo.h> void draw_curve2d(pccurve2d gr, cairo_t *cr, real scale)
Draw the polygon to a cairo surface.
const curve2d * pccurve2d
Abbreviation for a pointer to constant a curve2d object.
Definition: curve2d.h:35
pcurve2d new_hilbert_curve2d(uint n, real l)
Create a new Hilbert-curve of order . and edge length around the origin.
Representation of a polygon in 2D.
Definition: curve2d.h:46
unsigned uint
Unsigned integer type.
Definition: settings.h:70
pcurve2d new_square_curve2d(uint edges, real a)
Create a new square with edges and edge length around the origin.
pcurve2d new_circle_curve2d(uint edges, real r)
Create a new polygon approximation of a circle with edges and radius around the origin...
curve2d * pcurve2d
Abbreviation for a pointer to a curve2d object.
Definition: curve2d.h:30
void del_curve2d(pcurve2d gr)
Free Storage allocated for a curve2d object.
pcurve2d new_curve2d(uint vertices, uint edges)
create a new curve2d object with a certain number of vertice and edges.
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
double real
real floating point type.
Definition: settings.h:97
pcurve2d new_star_curve2d(uint edges, real r)
Create a new polygon of a star with 16 spikes, edges and radius around the origin.
void print_curve2d(pccurve2d gr)
print geometrical information to stdout.
real(* x)[2]
Vertex coordinates.
Definition: curve2d.h:53
real * preal
Pointer to real array.
Definition: settings.h:145
uint edges
Number of edges.
Definition: curve2d.h:50
void prepare_curve2d(pcurve2d gr)
This function computes the normal vectors n , the gram determinants g from the geometrical informatio...
preal g
Edge lengths = gram determinants.
Definition: curve2d.h:60
uint vertices
Number of vertices.
Definition: curve2d.h:48
uint(* e)[2]
Edge vertices.
Definition: curve2d.h:55
real(* n)[2]
Normal vectors.
Definition: curve2d.h:58