line(X+15*cos((fi+30)*RAD),DEK*(Y+15*sin((fi+30)*RAD)),X+15*cos((fi+330)*RAD),DEK*(Y+15*sin((fi+330)*RAD)));
line(X+15*cos((fi+210)*RAD),DEK*(Y+15*sin((fi+210)*RAD)),X+15*cos((fi+150)*RAD),DEK*(Y+15*sin((fi+150)*RAD)));
setlinestyle(0,0,1);
//fillellipse(X,DEK*Y,R_C,R_C);
return;
}
void okno(float x1,float y1,float x2,float y2)
{
setfillstyle(1,7);
setlinestyle(0,1,1);
bar(x1+2,y1+2,x2-2,y2-2);
setcolor(15);
line(x1,y1,x2,y1);
line(x1,y1,x1,y2);
line(x1+1,y1+1,x1+1,y2-1);
line(x1+1,y1+1,x2-1,y1+1);
setcolor(8);
line(x2-1,y1+1,x2-1,y2-1);
line(x1+1,y2-1,x2-1,y2-1);
setcolor(0);
line(x1,y2,x2,y2);
line(x2,y1,x2,y2);
return;
}
void ramka(float x1,float y1,float x2,float y2)
{
setlinestyle(0,1,1);
setcolor(15);
line(x1,y1,x2,y1);
line(x1,y1,x1,y2);
line(x1+1,y1+1,x1+1,y2-1);
line(x1+1,y1+1,x2-1,y1+1);
setcolor(8);
line(x2-1,y1+1,x2-1,y2-1);
line(x1+1,y2-1,x2-1,y2-1);
setcolor(0);
line(x1,y2,x2,y2);
line(x2,y1,x2,y2);
return;
}
void help()
{
char text[]="Машина 131 ряда";
int key;
setfillstyle(1,8);
bar(0,0,640,350);
okno(140,50,500,300);
setcolor(1);
outtextxy(150,60,text);
do
{
key=bioskey(1);
if(key==0x11b) break;
if(key!=0) {key=0;getch();}
}
while(key!=0x11b);
return;
}
void grafiki()
{
int key,x_x=0,fi,t=1;
setgraphmode(2);
setfillstyle(1,8);
bar(0,0,640,480);
okno(X-280,DEK*(Y-200),X+235,DEK*(Y+450));
osi(45,430,475,400,1);
setcolor(14);
outtextxy(640,20,"Вывод графика:");
outtextxy(640,450,"<ESCAPE>-Выход");
grafik(1);
do
{
key=bioskey(1);
if(key!=0 && x_x==0) {x_x=1;getch();}
if(key==0x4b00 && t>1) {t--;getch();}
if(key==0x4d00 && t<19) {t++;getch();}
if(key!=0) grafik(t);
if(key==0x11b) break;
if(key!=0) {key=0;getch();}
if(fi>=360) fi=0;
}
while(1==1);
getch();
setgraphmode(1);
return;
}
void osi(float x, float y, float l_x, float l_y, int color)
{
int i;
char buffer [80];
setcolor(color);
line(x,y,x+l_x,y);
line(x,y,x,y-l_y);
line(x,y-l_y,x-2,y-l_y+10);
line(x,y-l_y,x+2,y-l_y+10);
line(x+l_x,y,x+l_x-10,y+2);
line(x+l_x,y,x+l_x-10,y-2);
for(i=10;i<=360;i+=10)
{
setcolor(6);
line(x+i*1.2,y-l_y+40,x+i*1.2,y+1);
line(x-1,y-i,x+l_x-45,y-i);
setcolor(0);
sprintf(buffer,"%d",i);
settextstyle(0,0,0);
settextjustify(2,1);
outtextxy(x-2,y-i+1,buffer);
settextstyle(0,1,0);
settextjustify(1,2);
outtextxy(x+i*1.2,y+3,buffer);
}
settextstyle(0,0,0);
settextjustify(2,1);
return;
}
void grafik(int sign)
{
float i;
okno(X-280,DEK*(Y-200),X+235,DEK*(Y+450));
osi(45,430,475,400,1);
if(sign==1)outtextxy(44,45,"fi2");
if(sign==2)outtextxy(44,45,"fi3");
if(sign==3)outtextxy(44,45,"fi4");
if(sign==4)outtextxy(44,45,"fi5");
if(sign==5)outtextxy(44,45,"fi6");
if(sign==6)outtextxy(44,45,"fi7");
if(sign==7)outtextxy(44,45,"fi8");
if(sign==8)outtextxy(44,45,"fi9");
if(sign==9)outtextxy(44,45,"fi10");
if(sign==10)outtextxy(44,45,"fi11");
if(sign==11)outtextxy(44,45,"fi12");
if(sign==12)outtextxy(44,45,"fi13");
if(sign==13)outtextxy(44,45,"fi14");
if(sign==14)outtextxy(44,45,"fi15");
if(sign==15)outtextxy(44,45,"fi16");
if(sign==16)outtextxy(44,45,"fi17");
if(sign==17)outtextxy(44,45,"fi18");
if(sign==18)outtextxy(44,45,"fi19");
if(sign==19)outtextxy(44,45,"fi20");
outtextxy(510,440,"fi");
for(i=0;i<=360;i++)
{
raschet(i);
if(sign==1)putpixel(45+i*1.2,430-fi2,0);
if(sign==2)putpixel(45+i*1.2,430-fi3,0);
if(sign==3)putpixel(45+i*1.2,430-fi4,0);
if(sign==4)putpixel(45+i*1.2,430-fi5,0);
if(sign==5)putpixel(45+i*1.2,430-fi6,0);
if(sign==6)putpixel(45+i*1.2,430-fi7,0);
if(sign==7)putpixel(45+i*1.2,430-fi8,0);
if(sign==8)putpixel(45+i*1.2,430-fi9,0);
if(sign==9)putpixel(45+i*1.2,430-fi10,0);
if(sign==10)putpixel(45+i*1.2,430-fi11,0);
if(sign==11)putpixel(45+i*1.2,430-fi12,0);
if(sign==12)putpixel(45+i*1.2,430-fi13,0);
if(sign==13)putpixel(45+i*1.2,430-fi14,0);
if(sign==14)putpixel(45+i*1.2,430-fi15,0);
if(sign==15)putpixel(45+i*1.2,430-fi16,0);
if(sign==16)putpixel(45+i*1.2,430-fi17,0);
if(sign==17)putpixel(45+i*1.2,430-fi18,0);
if(sign==18)putpixel(45+i*1.2,430-fi19,0);
if(sign==19)putpixel(45+i*1.2,430-fi20,0);
}
return;
}