#ifndef RANDOM_H
#define RANDOM_H
#include <cstdlib>
#include "real.h"
#include "vector.h"
namespace rnd {
inline Real real()
{ return Real(rand())/Real(RAND_MAX); }
inline Real real(const Real &max)
{ return real()*max; }
inline Real real(const Real &min, const Real &max)
{ return min + real(max - min); }
inline Vector vector()
{ return Vector(real(), real()); }
inline Vector vector(const Real &maxx, const Real &maxy)
{ return Vector(real(maxx), real(maxy)); }
inline Vector vector(const Real &minx, const Real &miny, const Real &maxx, const Real &maxy)
{ return Vector(real(minx, maxx), real(miny, maxy)); }
inline Vector vector(const Vector &max)
{ return vector(max.x, max.y); }
inline Vector vector(const Vector &min, const Vector &max)
{ return vector(min.x, min.y, max.x, max.y); }
}
#endif