Message-ID: <36EE8469.14ED8663@bellsouth.net> From: Lester Davis X-Mailer: Mozilla 4.04 [en] (Win95; I) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Trig Help real code References: <36EE71C9 DOT 6A160A75 AT bellsouth DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 47 Date: Tue, 16 Mar 1999 16:18:39 GMT NNTP-Posting-Host: host-209-214-65-22.atl.bellsouth.net NNTP-Posting-Date: Tue, 16 Mar 1999 11:18:39 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In case it was not clear here is the acutal code I'm tying to display the results with. Right now I just want a swwep from 5 to 85 degrees, If I can get this to work the second qudrant shouldn't be that hard. Thanks Ringo // Sonarplt Sonar Plot for mapping a room // to compile gcc sonarplt.c -lalleg -lm #include // For the getch() function. #include #include "allegro.h" #include #include #define cone 10 void Plot_beam(int angle,int range,int conew,int color); int main() { //screen is 640 W 480 H int angle; int range; allegro_init(); set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0); clear(screen); while(!kbhit()) { textout(screen, font, "Sonar Ranging demo", 280, 470, 2); line(screen, 1,240, 630,240, 15); circle(screen, 320,240,10, 15); range=200; for(angle=5;angle<85;angle=angle+5) { Plot_beam(angle,range,cone,15); Plot_beam(angle,range,cone,255); } } allegro_exit(); return 0; } void Plot_beam(int angle,int range,int conew,int color) { int temprange=0; double x1,x2,y1,y2; int xa,xb,ya,yb; int posangle,negangle; for(temprange=15;temprange