#include #include "tectonics.h" void get_cairo_size(cairo_t *cr, int *width, int *height) { cairo_surface_t *surface = cairo_get_target(cr); *width = cairo_image_surface_get_width(surface); *height = cairo_image_surface_get_height(surface); } double rand01() { return ((double) rand())/RAND_MAX; } double distance(double x0, double y0, double x1, double y1) { double dx = x1-x0; double dy = y1-y0; return sqrt(dx*dx + dy*dy); }