Game Development Reference
In-Depth Information
and at this time, the height is equal to
h = y(t a ) = t a y 0 + (1/2)gt a
= (− y 0 /g) y 0 + (1/2)g(− y 0 /g) 2
= (− y 0 /g) + (1/2)( y 0 /g)
= − y 0 /2g.
Altitude at apex
We stated earlier that the time for the object to come back down to its
initial height (which we denoted t e ) was twice the time needed to reach its
apex; however, at that time we merely appealed to a diagram. This time,
let's verify it algebraically:
y(t) = t y 0 + (1/2)gt 2 ,
0 = t e y 0 + (1/2)gt e ,
Time to return to
initial altitude.
(initial position is at the origin)
−(1/2)gt e = t e y 0 ,
t e = −2 y 0 /g.
(divide by −(1/2)gt e )
As expected, the flight time t e is twice the time needed to reach the apex.
Now, let's compute d, the horizontal distance traveled:
d = x(t e ) = t e x 0 = −2 y 0 x 0 /g.
Horizontal travel
distance
Of course, t e and d are based on the assumption that we want to know
when the projectile returns to its initial altitude. This is important when
launching a projectile from a flat ground plane. If the projectile isn't
launched from the ground, or if the ground isn't flat, then we'll need to
consider where the parabola intersects the ground plane.
We often wish to specify the initial velocity in terms of an angle and
speed, rather than velocities along each axes. In other words, we wish to
use polar coordinates rather than Cartesian. As shown in Figure 11.13, we
denote the initial launch speed as s 0 (which is equal to the magnitude of v 0 )
and the launch angle as θ. Converting the initial velocity from Cartesian
to polar coordinates (see Section 7.1.3 if you don't remember how), we get
x 0 = s 0 cosθ,
y 0 = s 0 sinθ.
Plugging this into our kinematics Equations (11.20) and (11.21), we get the
equations of motion for a projectile in terms of its launch angle and speed:
x(t) = s 0 cosθ,
y(t) = s 0 sinθ + gt,
y(t) = ts 0 sinθ + (1/2)gt 2 .
x(t) = ts 0 cosθ,
Search WWH ::




Custom Search