CGAL 6.1.1 - Bounding Volumes

Loading...
Searching...
No Matches
Rectangular_p_center_2/rectangular_p_center_2.cpp
#include <CGAL/Simple_cartesian.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/rectangular_p_center_2.h>
#include <CGAL/IO/Ostream_iterator.h>
#include <CGAL/algorithm.h>
#include <iostream>
#include <algorithm>
#include <vector>
typedef double FT;
typedef CGAL::Simple_cartesian<FT> Kernel;
typedef Kernel::Point_2 Point;
typedef std::vector<Point> Cont;
typedef CGAL::Random_points_in_square_2<Point> Generator;
typedef CGAL::Ostream_iterator<Point,std::ostream> OIterator;
int main()
{
int n = 10;
int p = 3;
OIterator cout_ip(std::cout);
CGAL::IO::set_pretty_mode(std::cout);
Cont points;
std::copy_n(Generator(1), n, std::back_inserter(points));
std::cout << "Generated Point Set:\n";
std::copy(points.begin(), points.end(), cout_ip);
FT p_radius;
std::cout << "\n\n" << p << "-centers:\n";
CGAL::rectangular_p_center_2(
points.begin(), points.end(), cout_ip, p_radius, p);
std::cout << "\n\n" << p << "-radius = " << p_radius << std::endl;
return 0;
}
CGAL::Ostream_iterator
Kernel::Point_2
CGAL::rectangular_p_center_2
OutputIterator rectangular_p_center_2(ForwardIterator f, ForwardIterator l, OutputIterator o, FT &r, int p, const Traits &t=Default_traits)
Computes rectilinear -centers of a planar point set, i.e. a set of points such that the maximum mini...
CGAL::IO::set_pretty_mode
Mode set_pretty_mode(std::ios &s)
Kernel
CGAL::Simple_cartesian