diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-01 18:19:59 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-01 18:19:59 +0100 |
commit | 92d18c25a2ff68e76bc268b3ad891c78e4cb58d7 (patch) | |
tree | d60987465e74db0360d667999d065bb35d33c8a4 /geom.hpp | |
parent | cacec4dbb8b5cc017b9c6d9975f8f792db13cc7a (diff) | |
download | Robotique-Projet-92d18c25a2ff68e76bc268b3ad891c78e4cb58d7.tar.gz Robotique-Projet-92d18c25a2ff68e76bc268b3ad891c78e4cb58d7.zip |
Implement random point chosing algorithm
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; |