CGAL 6.1.1 - Bounding Volumes

Loading...
Searching...
No Matches
Min_sphere_d/min_sphere_homogeneous_3.cpp
#include <CGAL/Exact_integer.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Random.h>
#include <CGAL/Min_sphere_annulus_d_traits_3.h>
#include <CGAL/Min_sphere_d.h>
#include <iostream>
#include <cstdlib>
#include <array>
typedef CGAL::Homogeneous<CGAL::Exact_integer> K;
typedef CGAL::Min_sphere_annulus_d_traits_3<K> Traits;
typedef CGAL::Min_sphere_d<Traits> Min_sphere;
typedef K::Point_3 Point;
int
main ()
{
const int n = 10; // number of points
std::array<Point, n> P; // n points
CGAL::Random r; // random number generator
for (int i=0; i<n; ++i) {
P.at(i) = Point(r.get_int(0, 1000),r.get_int(0, 1000), r.get_int(0, 1000), 1 );
}
Min_sphere ms (P.begin(), P.end()); // smallest enclosing sphere
CGAL::IO::set_pretty_mode (std::cout);
std::cout << ms; // output the sphere
return 0;
}
Exact_integer.h
CGAL::Min_sphere_annulus_d_traits_3
The class Min_sphere_annulus_d_traits_3 is a traits class for the -dimensional optimization algorithm...
Definition: Min_sphere_annulus_d_traits_3.h:21
CGAL::Min_sphere_d
An object of the class Min_sphere_d is the unique sphere of smallest volume enclosing a finite (multi...
Definition: Min_sphere_d.h:75
CGAL::IO::set_pretty_mode
Mode set_pretty_mode(std::ios &s)
CGAL::Homogeneous