#include <iostream>
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Random.h>
#include <CGAL/MP_Float.h>
#include <CGAL/Gmpq.h>
#include <CGAL/Timer.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

// Faire son choix de type de nombre et Kernel
typedef float                               Number_type;
//typedef CGAL::MP_Float                               Number_type;

typedef CGAL::Cartesian<Number_type>        K;
//typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

typedef CGAL::Point_2<K> 		    Point;
typedef CGAL::Delaunay_triangulation_2<K>  Delaunay;

int main( int argc, char **argv )
{
    Delaunay dt1;

    int Nb_points;
    CGAL::Timer cost;cost.reset();cost.start();

    std::cout<<" Nombre de points ? "<<std::endl;
    std::cin>>Nb_points;
    CGAL::Random random(5);
    Number_type drte_a = random.get_double();
    Number_type drte_b = random.get_double();

    for( int i = 0 ; i<Nb_points;++i) {
      Number_type x = random.get_double(-0.9,0.9);
      Number_type y = drte_a * x + drte_b; // le point (x,y) est sur la droite d'equation y=ax+b
      //Number_type y = random.get_double(-0.9,0.9); // point aleatoire dans un carré
      //Number_type y = x*x; // le point (x,y) est sur la parabole y=x^2
       dt1.insert( Point( x, y ) );
      std::cout<<i<<" "<<std::endl;
    }
	
    std::cout<<std::endl<<Nb_points<<" points en "
             <<cost.time()<<" secondes"<<std::endl;
}
