home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d132
/
berserk
/
mot
/
bikepath.c
< prev
next >
Wrap
Text File
|
1988-03-13
|
840b
|
45 lines
/* :ts=8 bk=0
*/
#define FRAMES 46
#define GRAVITY 0.6
#define VINIT 27.6
#define YBASE 200.0
#define SX 145.1227
#define EX 111.0721
main ()
{
float x, y, step, pitch, twist, tilt;
register int i;
/* Left to right flight */
step = (SX + EX) / FRAMES;
pitch = twist = 0;
tilt = -90;
for (i=0, x=-SX; i<FRAMES; i++) {
y = -GRAVITY * i*i + VINIT * i;
printf ("%.4f %.4f 0\t%.4f %.4f %.4f\n",
x, y+YBASE, twist, pitch, tilt);
twist += 360.0 / FRAMES;
tilt += 180.0 / FRAMES;
x += step;
}
puts ("");
/* Right to left flight */
pitch = twist = 0;
tilt = 90;
for (i=0, x=SX; i<FRAMES; i++) {
y = -GRAVITY * i*i + VINIT * i;
printf ("%.4f %.4f 0\t%.4f %.4f %.4f\n",
x, y+YBASE, twist, pitch, tilt);
twist += 360.0 / FRAMES;
tilt += 540.0 / FRAMES;
pitch -= 360.0 / FRAMES;
x -= step;
}
}