// Emacs: -*- C++ -*-

static char rcsid[] = "$Id: point-utils.c,v 1.1 92/09/07 13:26:46 thoth Exp $";

//
// $Log:	point-utils.c,v $
// Revision 1.1  92/09/07  13:26:46  thoth
// Initial revision
// 
//

#include <stdlib.h>

#include "IntPoint.h"
#include "point-utils.h"


IntPoint
make_random_point(unsigned dim, int bottom, int top )
{
    int   range;

    if (top < bottom) {
	int temp = top;
	top = bottom;
	bottom = temp;
    }
    range = top - bottom + 1;    

#define randlong()	lrand48()

    int	*ip = new int [dim];

    for (unsigned idx=0; idx<dim; idx++)
	ip[idx] = (int) (bottom +  randlong() % range);
    return IntPoint(ip, dim, 1);
}
