aboutsummaryrefslogtreecommitdiff
path: root/geom.hpp
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-01 18:19:59 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-01 18:19:59 +0100
commit92d18c25a2ff68e76bc268b3ad891c78e4cb58d7 (patch)
treed60987465e74db0360d667999d065bb35d33c8a4 /geom.hpp
parentcacec4dbb8b5cc017b9c6d9975f8f792db13cc7a (diff)
downloadRobotique-Projet-92d18c25a2ff68e76bc268b3ad891c78e4cb58d7.tar.gz
Robotique-Projet-92d18c25a2ff68e76bc268b3ad891c78e4cb58d7.zip
Implement random point chosing algorithm
Diffstat (limited to 'geom.hpp')
-rw-r--r--geom.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/geom.hpp b/geom.hpp
index 06b9e65..e69fb81 100644
--- a/geom.hpp
+++ b/geom.hpp
@@ -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;