## CGAL::perturb_points_2

### Definition

The function perturb_points_2 perturbs each point in a given range of points by a random amount.

#include <CGAL/point_generators_2.h>

template <class ForwardIterator>

void

perturb_points_2 (
| ForwardIterator first, ForwardIterator last, double xeps, double yeps = xeps, Random& rnd = default_random, Creator creator = Creator_uniform_2<Kernel_traits<P>::Kernel::RT,P>)

|  | perturbs the points in the range [first,last) by replacing each point with a random point from the xeps × yeps rectangle centered at the original point. Two random numbers are needed from rnd for each point.

### Requirements

- Creator must be a function object accepting two double values x and y and returning an initialized point (x,y) of type P.

  Predefined implementations for these creators like the default are described in Section .

- The value_type of the ForwardIterator must be assignable to P.
- P is equal to the value_type of the ForwardIterator when using the default initializer.
- The expressions to_double((*first).x()) and to_double((*first).y()) must result in the respective coordinate values.

### See Also

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