Date: Tue, 3 Mar 1998 16:49:55 -0500 (EST) From: Michael Phelps To: Vlad Pambucol cc: djgpp AT delorie DOT com Subject: Re: trigonometry problem (math.h) In-Reply-To: <34FC4875.8672A6F3@usa.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 3 Mar 1998, Vlad Pambucol wrote: > I don't follow where is the problem??? > > float voy; > float x, units, second; > int angle; try "double angle;" instead. As you have it now, the angle is sharply restricted by the declaration as an integer. It's also best if you explicitly link in the math library (gcc sourcefile.c -o yourprog.exe -lm), even though it's not necessary to do so in DJGPP V2. ---Michael Phelps > ... > voy = x * (units/second) * sin(angle); > printf("%f",voy); > //the angle is in rad. > > Jesse Meyer wrote: > > > I am writing some code to determine the vertical velocity of a > > projectile. > > > > The physics equation is voy = x (units/second) * sin(angle) > > > > I want to design a program that will calculate this given the inital > > velocity (x) and the angle. > > > > I am using DJGPP v2.01 and RHIDE 1.4 > > > > This is basically a programming question because I am a begginer and all > > the books I read don't go into using Trig with C. > > > > Thanks in advance > > Jesse > > > >