#include #include #include #include void main() { struct point { int x,y; } p1, pbe; int lon,sho,Drive, Mode; float i, tx, ty, x, y, min, max; int j, wl, x1=0, y1=0, m; printf("give me the original point --> "); scanf("%d %d",&p1.x,&p1.y); printf("input the range min max --> "); scanf("%f %f",&min,&max); printf("give me the wave length --> "); scanf("%d",&wl); Drive=DETECT; initgraph(&Drive, &Mode, ""); setcolor(14); line(p1.x,0, p1.x,479); line(0,p1.y,639,p1.y); /* coordinate line */ for (j=m=0,i=min; i<=max; i+=0.05) { x=p1.x+i*wl; y=p1.y+wl*tan(i); if ((x >= 0) && (x <= 639) && (y >= 0) && (y <= 479)) { /* if (j == 0) { moveto(x1,y1); j=1; } else lineto(x1,y1); */ putpixel(x,y,14); x1=x; y1=y; delay(20); } } getche(); closegraph(); }