Добавил:
korayakov
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Курсовые / Курсовые ЭТМО / 02 / BETTASER
.CPP#include <stdio.h>
#include<stdlib.h>
#include<math.h>
#include<graphics.h>
#include<dir.h>
#include<dos.h>
#include<conio.h>
#include<string.h>
#include<float.h>
/*--------------------------initilization-------------------------------*/
void init(void)
{ int drive,mode,err,lowest,highest; double k;double t; double x;
double y; int i,j;
drive = DETECT;
initgraph(&drive,&mode,"");
err = graphresult();
if( err != grOk)
{ printf(" Error graphics: %s" , grapherrormsg(err));
exit(10);
}
}
/***************************************************************************/
/*----------------coordination-------------------------------------------*/
void coord(void)
{
int i,j;
setcolor(14);
for (i = 100; i <= 500;i = i +100)
{ for ( j = 1; j <= 200; j = j + 3)
putpixel(60+i,305 - j,10);
}
for (i = 0; i <= 540;i = i + 3)
{ for ( j = 30; j <= 180; j = j + 30)
putpixel(60+i,300 - j,10);
}
}
/**************************************************************************/
void main(void)
{
int drive,mode,err,lowest,highest; double k;double t; double x;
double y; int i,lkey,j,color,step;
/*---------------initilization graphic support--------------*/
init();
cleardevice();
/*---------------bilder base lines-----------------------------*/
moveto(60,300);
lineto(600,300);
moveto(60,300);
lineto(60,90);
lineto(62,100);
lineto(58,100);
lineto(60,90);
line(590,298,590,302);
line(590,302,600,300);
line(600,300,590,298);
moveto(60,300);
/*------------------base from sistem coordination----------------*/
coord();
/*----------switcer on the abciss line------------------*/
setcolor(14);
outtextxy(55,308,"0.1");
outtextxy( 155,308,"1");
outtextxy( 255,308,"10");
outtextxy( 355,308,"100");
outtextxy( 455,308,"1000");
outtextxy( 555,308,"10000");
outtextxy(20,300," 0");
outtextxy(20,270,"15");
outtextxy(20,240,"30");
outtextxy(20,210,"45") ;
outtextxy(20,180,"60") ;
outtextxy(20,150,"75") ;
outtextxy(20,120,"90") ;
outtextxy(10,440,"copyright by @Timur Ardintsev") ;
outtextxy(10,460,"betta-version 2003 ") ;
outtextxy(60,80,"F(w)");
circle(93,78,2);
outtextxy(610,300,"W ") ;
outtextxy(605,310," 1") ;
outtextxy(605,317,"---");
outtextxy(605,321,"sek");
setcolor(12);
outtextxy(380,460,"optimization by Windows Longhorn");
setbkcolor(1);
setcolor(14);
i = 1;
rectangle(390,40,630,10);
rectangle(100,40,350,10);
setcolor(14);
lkey = 0;
color = 0;
step = 0;
textcolor(2);
for( j = 1 ;
j <= 4; j++)
{ gotoxy(71,2) ;
setcolor(12);
outtextxy(400,17,"Input constant ");
outtextxy(410,28,"(0.1...0.0001)");
scanf("%lf",&t);
gotoxy(42,2) ;
outtextxy(110,17,"do you want is APRO-3D?");
outtextxy(120,28,"(1 - yes / 0 - no");
scanf("%d",&lkey);
moveto(60,120);
for(k = -1; k <= 4 ; k = k + 0.01)
{
x = pow(10,k);
y = 2 * (90 - atan(x * t)*57.3);
setcolor(12+color);
lineto(60 + i,300 - y);
if( lkey == 1 )
{ setcolor(11);
bar3d(60+i,300,65+i,300-y,80,0);
setcolor(12+color);}
i = i + 1 ;
delay(2);
}
line(500,340+step,550,340+step);
gotoxy(71,22+color);
printf("t=%f", t);
setcolor(8);
floodfill(450,30,14);
i = 1 ;
coord() ;
color = color + 1 ;
step = step +17 ;
}
}