// HEADER FILES USED #include #include #include // FUNCTIONS USED void introduction(); void segments(); void satellite_symbol(); void projectwork(); void proj1(); void proj2(); void proj3(); void proj4(); void closing(); void main() { int gd=DETECT,gm; initgraph(&gd,&gm,"c:\\turboc3\\bgi"); introduction(); segments(); satellite_symbol(); projectwork(); closing(); getch(); closegraph(); restorecrtmode(); } /* TO DISPLAY THE NAME OF THE PROGRAMMER */ void introduction() { setbkcolor(RED); setcolor(YELLOW); delay(1000); settextstyle(7,0,6); outtextxy(90,50,"GPS System Demo"); delay(1000); setcolor(WHITE); outtextxy(240,150,"Project"); delay(1000); outtextxy(270,250,"in C"); setcolor(YELLOW); delay(1000); settextstyle(7,0,2); outtextxy(100,350,"By : Manuj Arora"); delay(2000); cleardevice(); } /* TO DISPLAY MAJOR SEGMENTS OF GPS */ void segments() { setbkcolor(BLUE); setcolor(YELLOW); settextstyle(7,0,6); delay(1000); outtextxy(100,100,"Major Segments"); delay(500); outtextxy(280,200,"Of"); delay(1000); outtextxy(230,300,"G P S "); delay(3000); cleardevice(); setcolor(WHITE); settextstyle(8,0,4); outtextxy(100,40,"GPS Segments"); delay(1000); circle(450,120,75); setfillstyle(1,LIGHTGREEN); floodfill(450,120,WHITE); setcolor(RED); settextstyle(8,0,2); outtextxy(405,100,"CONTROL"); setcolor(WHITE); delay(1000); setcolor(YELLOW); moveto(375,120); lineto(225,225); moveto(225,225); lineto(245,205); moveto(225,225); lineto(250,215); delay(1000); setcolor(WHITE); circle(150,250,75); setfillstyle(1,CYAN); floodfill(175,275,WHITE); setcolor(RED); settextstyle(8,0,3); outtextxy(115,225,"SPACE"); delay(1000); setcolor(YELLOW); moveto(222,272); lineto(370,365); moveto(370,365); lineto(350,345); moveto(370,365); lineto(347,359); delay(1000); circle(450,370,75); setfillstyle(1,LIGHTRED); floodfill(450,370,YELLOW); setcolor(RED); outtextxy(420,350,"USER"); delay(5000); cleardevice(); } /* SYMBOL USED FOR SATELLITE IN THE PROGRAM */ void satellite_symbol() { setbkcolor(CYAN); setcolor(RED); delay(1000); settextstyle(7,0,4); outtextxy(170,40,"SYMBOL USED"); delay(500); outtextxy(275,80,"FOR"); delay(1000); settextstyle(7,0,4); outtextxy(215,120,"SATELLITE"); delay(1000); setcolor(BLUE); circle(305,250,20); setfillstyle(9,RED); floodfill(305,250,BLUE); setfillstyle(9,BROWN); rectangle(255,200,285,300); floodfill(260,250,BLUE); rectangle(325,200,355,300); floodfill(350,250,BLUE); delay(2000); cleardevice(); } /* TO DEMO - How GPS WORKS ?( 3D TRILATERATION ) */ void projectwork() { setbkcolor(BLUE); setcolor(WHITE); settextstyle(7,0,6); delay(1000); outtextxy(80,150,"How GPS Works ?"); delay(2000); setcolor(YELLOW); outtextxy(80,250,"3D TRILATERATION " ); delay(2000); cleardevice(); proj1(); proj2(); proj3(); proj4(); } /* TO DISPLAY REGION WHEN 1 SATELLITE IS CONSIDERED */ void proj1() { setbkcolor(BLUE); setcolor(YELLOW); settextstyle(7,0,4); outtextxy(130,30,"No. of Satellites Used : 1"); delay(1000); setcolor(WHITE); circle(320,240,150); setfillstyle(1,YELLOW); floodfill(320,240,WHITE); setcolor(GREEN); setfillstyle(9,BROWN); circle(320,240,10); floodfill(320,240,GREEN); rectangle(290,220,310,260); floodfill(300,240,GREEN); rectangle(330,220,350,260); floodfill(340,240,GREEN); moveto(320,240); lineto(350,387); moveto(350,387); lineto(345,376); moveto(350,387); lineto(350,375); delay(1000); setcolor(YELLOW); outtextxy(100,400,"Region : Imaginary Sphere"); delay(3000); cleardevice(); } /* TO DISPLAY REGION WHEN 2 SATELLITES ARE CONSIDERED */ void proj2() { setbkcolor(BLUE); setcolor(YELLOW); settextstyle(7,0,4); outtextxy(110,30,"No. of Satellites Used : 2"); delay(1000); setcolor(YELLOW); circle(250,220,100); circle(370,220,100); setfillstyle(1,GREEN); floodfill(252,222,YELLOW); floodfill(372,220,YELLOW); setcolor(YELLOW); circle(250,220,5); rectangle(235,205,245,235); rectangle(255,205,265,235); setfillstyle(9,RED); floodfill(252,222,YELLOW); floodfill(240,210,YELLOW); floodfill(260,210,YELLOW); circle(370,220,5); rectangle(355,205,365,235); rectangle(375,205,385,235); floodfill(372,222,YELLOW); floodfill(357,207,YELLOW); floodfill(377,207,YELLOW); ellipse(310,220,90,89,10,81); setfillstyle(1,LIGHTBLUE); floodfill(315,230,YELLOW); setfillstyle(1,GREEN); floodfill(340,220,YELLOW); floodfill(280,220,YELLOW); delay(1000); setcolor(YELLOW); outtextxy(100,400,"Region : Common Circular"); delay(1000); setcolor(WHITE); moveto(350,410); lineto(315,290); moveto(315,290); lineto(320,300); moveto(315,290); lineto(317,305); delay(3000); cleardevice(); setbkcolor(BLACK); setcolor(YELLOW); settextstyle(7,0,4); delay(1000); outtextxy(110,20,"Another View of Two Satellites"); delay(1000); setcolor(RED); arc(250,180,53,307,100); arc(370,180,233,127,100); setcolor(BLUE); ellipse(310,181,90,89,10,81); setcolor(RED); setfillstyle(9,LIGHTGREEN); circle(250,180,5); floodfill(252,182,RED); rectangle(235,165,245,195); floodfill(240,170,RED); rectangle(255,165,265,195); floodfill(260,170,RED); circle(370,180,5); floodfill(372,182,RED); rectangle(355,165,365,195); floodfill(360,170,RED); rectangle(375,165,385,195); floodfill(380,170,RED); setcolor(YELLOW); delay(1000); outtextxy(110,330,"No. of Satellites Used : 2"); delay(1000); outtextxy(160,400,"Region : Blue Ring"); delay(2000); cleardevice(); } /* TO DISPLAY REGION WHEN 3 SATELLITES ARE CONSIDERED */ void proj3() { setbkcolor(BLACK); setcolor(YELLOW); settextstyle(7,0,4); delay(1000); outtextxy(110,20,"No. of Satellites Used : 3"); delay(1000); setcolor(RED); arc(250,180,53,307,100); arc(370,180,233,127,100); setcolor(BLUE); ellipse(310,181,90,89,10,81); ellipse(310,240,0,359,75,10); setcolor(RED); arc(310,305,138,42,100); setfillstyle(9,LIGHTGREEN); circle(250,180,5); floodfill(252,182,RED); rectangle(235,165,245,195); floodfill(240,170,RED); rectangle(255,165,265,195); floodfill(260,170,RED); circle(370,180,5); floodfill(372,182,RED); rectangle(355,165,365,195); floodfill(360,170,RED); rectangle(375,165,385,195); floodfill(380,170,RED); circle(310,305,5); floodfill(312,307,RED); rectangle(295,290,305,320); floodfill(300,295,RED); rectangle(315,290,325,320); floodfill(320,295,RED); circle(318,230,3); setfillstyle(1,YELLOW); floodfill(319,231,RED); circle(305,250,3); floodfill(306,251,RED); delay(1000); setcolor(YELLOW); outtextxy(130,410,"Region : Two Points " ); delay(500); setcolor(RED); setfillstyle(1,BLUE); floodfill(319,231,RED); floodfill(306,251,RED); delay(500); setfillstyle(1,YELLOW); floodfill(319,231,RED); floodfill(306,251,RED); delay(500); setfillstyle(1,BLUE); floodfill(319,231,RED); floodfill(306,251,RED); delay(500); setfillstyle(1,YELLOW); floodfill(319,231,RED); floodfill(306,251,RED); delay(500); setfillstyle(1,BLUE); floodfill(319,231,RED); floodfill(306,251,RED); delay(500); setfillstyle(1,YELLOW); floodfill(319,231,RED); floodfill(306,251,RED); delay(500); setfillstyle(1,BLUE); floodfill(319,231,RED); floodfill(306,251,RED); delay(500); setfillstyle(1,YELLOW); floodfill(319,231,RED); floodfill(306,251,RED); delay(3000); cleardevice(); } /* TO DISPLAY REGION WHEN 4 SATELLITES ARE CONSIDERED */ void proj4() { setbkcolor(BLACK); delay(1000); setcolor(YELLOW); settextstyle(7,0,4); outtextxy(130,30,"No. of Satellites Used : 4 " ); delay(1000); setcolor(RED); circle(230,220,100); circle(230,220,5); rectangle(215,205,225,235); rectangle(235,205,245,235); setfillstyle(9,LIGHTGREEN); floodfill(232,222,RED); floodfill(220,210,RED); floodfill(240,210,RED); circle(350,170,100); circle(350,170,5); rectangle(335,155,345,185); rectangle(355,155,365,185); floodfill(352,172,RED); floodfill(340,160,RED); floodfill(360,160,RED); circle(220,270,100); circle(220,270,5); rectangle(205,255,215,285); rectangle(225,255,235,285); floodfill(222,272,RED); floodfill(210,260,RED); floodfill(230,260,RED); circle(402,320,100); circle(402,320,5); rectangle(387,305,397,335); rectangle(407,305,417,335); floodfill(404,322,RED); floodfill(390,310,RED); floodfill(410,310,RED); delay(1000); setcolor(YELLOW); settextstyle(7,0,4); outtextxy(100,420,"Region : Precisely One Point"); setcolor(BLUE); circle(320,265,4); setfillstyle(1,YELLOW); floodfill(322,267,BLUE); delay(500); setfillstyle(1,RED); floodfill(322,267,BLUE); delay(500); setfillstyle(1,YELLOW); floodfill(322,267,BLUE); delay(500); setfillstyle(1,RED); floodfill(322,267,BLUE); delay(500); setfillstyle(1,YELLOW); floodfill(322,267,BLUE); delay(500); setfillstyle(1,RED); floodfill(322,267,BLUE); delay(500); setfillstyle(1,YELLOW); floodfill(322,267,BLUE); delay(500); setfillstyle(1,RED); floodfill(322,267,BLUE); delay(500); setfillstyle(1,YELLOW); floodfill(322,267,BLUE); delay(3000); cleardevice(); } /* TO DISPLAY EXIT OPTION */ void closing() { setbkcolor(RED); setcolor(YELLOW); settextstyle(7,0,4); delay(1000); outtextxy(150,180,"!!! Thank You !!!"); outtextxy(110,270,"Press any Key to EXIT " ); }