# Module MMTK.Random

This module defines various random quantities that are useful in molecular simulations. For obtaining random numbers, it tries to use the RNG module, which is part of the LLNL package distribution, which also contains Numerical Python. If RNG is not available, it uses the random number generators in modules RandomArray (part of Numerical Python) and whrandom (in the Python standard library).

## Functions

- randomPointInBox()

  Returns a vector drawn from a uniform distribution within a rectangular box with edge lengths a, b, c. If b and/or c are omitted, they are taken to be equal to a.

- randomPointInSphere()

  Returns a vector drawn from a uniform distribution within a sphere of radius r.

- randomDirection()

  Returns a vector drawn from a uniform distribution on the surface of a unit sphere.

- randomDirections()

  Returns a list of n vectors drawn from a uniform distribution on the surface of a unit sphere. If n is negative, return a deterministic list of not more than -|n| vectors of unit length (useful for testing purposes).

- randomRotation()

  Returns a Rotation object describing a random rotation with a uniform axis distribution and angles drawn from a uniform distribution between -|max_angle| and max_angle.

- randomVelocity()

  Returns a random velocity vector for a particle of a given mass, drawn from a Boltzmann distribution for the given temperature.

- randomParticleVector()

  Returns a ParticleVector object in which each vector is drawn from a Gaussian distribution with a given width centered around zero.