Fw: Anyone know anything about trigonometry? re:digest issue 809
- Posted by mswayze at TRUSWOOD.COM Sep 07, 2001
- 432 views
> David S., > I'm not sure if this will help, as you will need to make the velocities > vectors dependent on the angle you initially 'shoot' at. > simplified equation of motion is > x=x0 + v0t + 1/2at**2 > where x0 is the initial location ,vo is the initial velocity and a is > the > acceleration. > for a projectile(simplified) you would have only acceleration due to > gravity > (9.84m/s) pulling the projectile down and the forward motion would > continue > until the projectile hits the ground or target. > > assuming you shoot straight out (no angles) the x distance would be v0t, > where t is time and v0 is the initial velocity. > > the y distance the projectile travels would be y0 (initial y > distance(possibly zero-with negative ending point)) plus zero (since the > initial y direction velocity would be zero) plus 1/2* (-9.84m/s) * t**2 > until the time is reached where it impacts the ground or target, etc. > > vector formats normally use i or j or k to define the directions (see > previous emails about using the trig functions for direction of initial > velocity).the math gets a little complicated in 3d as you would then > start > using dot and cross product to determine final directions, but you > shouldn't > need to go there for a projectil path game in 2d. > have fun > Mike > Swayze > mswayze at truswood.com > kswayze at bellsouth.net > >