From: "Jos A. Horsmeier" Newsgroups: comp.os.msdos.djgpp,comp.lang.c Subject: Re: trigonometry problem (math.h) Date: Wed, 04 Mar 1998 14:30:03 +0100 Organization: AND Software B.V. Rotterdam Message-ID: <34FD575B.F11FCD3D@and.nl> References: <34FC314E DOT A9B3F9D6 AT usa DOT net> NNTP-Posting-Host: beach.and.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 32 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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. If the 'sin' function is the problem, all you have to do is include at the top of your source file, add your code, and compile the stuff. Don't forget to link in the math library (check your manuals for the correct command line flags) and voila! Here are some formulas: - V(0) is the initial velocity - Vv(0)= V(0)*sin(angle) is the vertical component - Vv(t)= Vv(0)-g*t (g == gravity ~ 9.81 m/s^2) And remember, whatever goes up comes down; here's some code: int O,o,Oo=10*0x11; main(){for (O=!0<