| Home | Libraries | People | FAQ | More

## Class template uniform_on_sphere

boost::uniform_on_sphere

## Synopsis

    // In header: <boost/random/uniform_on_sphere.hpp>

    template<typename RealType = double, typename Cont = std::vector<RealType> >
    class uniform_on_sphere {
    public:
      // types
      typedef RealType input_type;
      typedef Cont     result_type;

      // construct/copy/destruct
      uniform_on_sphere(int = 2);

      // public member functions
      void reset();
      template<typename Engine> const result_type & operator()(Engine &);
    };

## Description

Instantiations of class template uniform_on_sphere model a random distribution . Such a distribution produces random numbers uniformly distributed on the unit sphere of arbitrary dimension `dim`. The `Cont` template parameter must be a STL-like container type with begin and end operations returning non-const ForwardIterators of type `Cont::iterator`. Each invocation of the `UniformRandomNumberGenerator` shall result in a floating-point value in the range [0,1).

### `uniform_on_sphere` public construct/copy/destruct

1.     uniform_on_sphere(int dim = 2);

   Constructs a `uniform_on_sphere` distribution. `dim` is the dimension of the sphere.

### `uniform_on_sphere` public member functions

1.     void reset();

2.     template<typename Engine> const result_type & operator()(Engine & eng);