#define __RAWKS_SIN__
#define DBG 0

#include "defines.h"
#include <math.h>
#include <stdlib.h>
#include "globals.h"

void make_math_tables(void)
{
  int i;

  for(i=0;i<512;i++) {
    Sintable[i] = (float) sin(((double)(i%255)*2*M_PI)/255);
    Costable[i] = (float) cos(((double)(i%255)*2*M_PI)/255);
    Rndtable[i] = (float) drand48();
  }
}

float fast_rand(void) /* system rands can take up too much time */
{
  static index=0;

  if(++index >= 512) index = 0;

  return drand48();
/*  return Rndtable[index]; */
}
