Mail Archives: djgpp/1998/03/03/16:53:19
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
>
>
>
>
- Raw text -