<< Chapter < Page | Chapter >> Page > |
Since this definition does not specify velocity, it also applies to objects initially moving upward (which is the case with our arrow that was shot upward).
Free fall was demonstrated on the moon by astronaut David Scott on August 2, 1971. He simultaneously released a hammer and a feather from the same heightabove the moon's surface. The hammer and the feather both fell at the same rate and hit the ground at the same time. This demonstrated Galileo's discovery thatin the absence of air resistance, all objects experience the same acceleration due to gravity.
By the way, it is no accident that the value shown for acceleration in Figure 4 matches the value specified for the acceleration of gravity near the beginning of the code in Listing 3 .
Analysis of the code
The code in Listing 3 is very similar to the code in Listing 2 with the addition of the code necessary to estimate the acceleration values on the basisof the slope of the velocity curve.
The code that estimates the acceleration in Listing 3 is so similar to the code that estimates the velocity in Listing 2 that I won't bore you by explaining the code in detail.
However, there is one bit of new code that is worthy of note. Without going into detail as to the reasons why, this procedure is incapable of accuratelyestimating the slope of the velocity curve during the first two time intervals. Therefore, an if statement was written into the while loop to force the acceleration estimate to be zero for the first two timeintervals.
In the previous exercises, the arrow was shot straight up in the air. However, that is rarely the case. Normally, an arrow is shot in an attempt to strike a targetsome horizontal distance away.
A more realistic scenario
Let's modify our scenario such that the archer shoots the arrow with an initial velocity of 100 feet per second at an angle of45 degrees relative to the horizontal axis. We will compute and plot the horizontal and vertical position of the arrow at uniform increments in time from thebeginning to the end of its trajectory.
Motion of a projectile with uniform acceleration
The following equation describes the straight-line motion of a projectile with uniform acceleration .
d = v0*t +0.5*a*t^2
where
As usual, the units for distance, time, velocity, and acceleration must be consistent with one another.
Shooting the arrow straight up
If we shoot an arrow straight up, as was the case in the previous exercises, the initial velocity doesn't have a horizontal component. Instead, the initialvelocity has only a vertical component and the corresponding motion of the arrow has only a vertical component. In other words, the arrow goes straight up and it comesdown in the same spot.
Shooting the arrow other than straight up
However, if we shoot the arrow in a direction other than straight up or straight down, the initial velocity has both a vertical component and ahorizontal component. Therefore, the resulting motion has both a vertical component and a horizontal component.
Notification Switch
Would you like to follow the 'Game 2302 - mathematical applications for game development' conversation and receive update notifications?