diff options
Diffstat (limited to 'geom.hpp')
-rw-r--r-- | geom.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1,5 +1,6 @@ #pragma once +#include <stdlib.h> #include <math.h> #include <algorithm> #include <assert.h> @@ -7,6 +8,11 @@ #define EPSILON 1e-6 #define abs(x) ((x)<0?-(x):(x)) +inline double frand(double a, double b) { + double r = ((double)rand()) / ((double)RAND_MAX); + return r * (b - a) + a; +} + struct vec { double x, y; |