home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Party 1994: Try This At Home
/
disk_image.bin
/
source
/
cloak
/
mapping.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-12-09
|
925b
|
43 lines
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main (int argc, char** argv)
{
double Angle;
long dx, dy, dt;
int cMapping;
int i, j;
if (argc==3)
{
srand (atoi(argv[2]));
argc--;
}
else
srand (time(NULL));
if (argc == 2)
{
cMapping=atoi(argv[1]);
if (cMapping>8)
cMapping=8;
for (i=0; i<cMapping; i++)
{
for (j=0; j<3; j++)
{
Angle=(double)rand()/RAND_MAX*2*M_PI;
dx=(long)(sin(Angle)*4*65536);
dy=(long)(cos(Angle)*4*65536);
dt=(long)((double)rand()*1.5/RAND_MAX*524288-262144);
printf ("Ydx%1d%1d =\t\t%ld\n", i, j, dx);
printf ("Ydy%1d%1d =\t\t%ld\n", i, j, dy);
printf ("Ydt%1d%1d =\t\t%ld\n", i, j, dt);
printf ("Yt%1d%1d dd\t\t0\n", i, j);
}
printf ("\n");
}
}
return 0;
}