CGAL::random_collinear_points_2

Definition

#include <CGAL/point_generators_2.h>

template <class RandomAccessIterator, class OutputIterator>
OutputIterator
random_collinear_points_2 (
RandomAccessIterator first,
RandomAccessIterator last,
std::size_t n,
OutputIterator first2,
Random& rnd = default_random,
Creator creator = Creator_uniform_2<Kernel_traits<P>::Kernel::RT,P>)
randomly chooses two points from the range [first,last), creates a random third point on the segment connecting these two points, writes it to first2, and repeats this n times, thus writing n points to first2 that are collinear with points in the range [first,last). Three random numbers are needed from rnd for each point. Returns the value of first2 after inserting the n points.

Requirements

See Also

CGAL::perturb_points_2
CGAL::points_on_segment_2
CGAL::points_on_square_grid_2
CGAL::random_selection
std::random_shuffle