#include <graphics.h>
#include <conio.h>
#include <dos.h>
#include <math.h>
#include <process.h>
#include <stdio.h>
#define PI M_PI
#define END 2011.2
void ginit()
{
int driver=DETECT,mode,err;
initgraph(&driver,&mode,"D:\\TC\\BGI");
/*if (grOK!=(err=graphresult())
{
printf("Error: %s\n",grapherrormsg(err);
exit(1);
} */
}
void gend()
{
sound(3500);
delay(400);
nosound();
getch();
cleardevice();
closegraph();
}
void set0(int x0,int y0)
{
setviewport(x0,y0,639,399,0);
}
double LPX=0.0,LPY=0.0;
double ANGLE=0.0,RADIAN=0.0;
void setlp(double lpx,double lpy)
{
LPX=lpx; LPY=lpy;
}
void setangle(double angle)
{
ANGLE=angle; RADIAN=ANGLE*M_PI/180;
}
void turn(double angle)
{
ANGLE+=angle;
ANGLE=ANGLE-(int)ANGLE+(int)ANGLE %360;
RADIAN=ANGLE*M_PI/180;
}
void warp(double length)
{
LPX+=length*cos(RADIAN);
LPY-=length*sin(RADIAN);
}
void move(double length)
{
double x,y;
x=LPX+length*cos(RADIAN);
y=LPY-length*sin(RADIAN);
line(LPX,LPY,x,y);
LPX=x;
LPY=y;
}

浙公网安备 33010602011771号