Real-Life Math -- Solution
Solution:
Where is the tank at 0.3 minutes?
To
discover where the tank is at 0.3 minutes, change 10 miles per hour to minutes.
1
hour = 60 minutes
10 mi / 60 minutes
0.166 mi/minute
The
tank is moving at 0.166 miles per minute.
Now convert the distance
to pixels.
1 mi = 500 pixels
0.166 mi
per minute x 500 pixels per mi = 83.33 pixels per minute
So
at 0.3 minutes, the tank will be at:
0.3 minutes x 83.33
pixels per minute = 25 pixels
At 4.5 minutes, the tank
will be at:
4.5 minutes x 83.33 pixels per minute = 375
pixels
If the screen refreshes at 10 times a second,
(taking into account you don't want the computer to calculate the tank's position
any more often than necessary), how many game cycles (screen refreshes) can
you skip before calculating the tank's position such that it moves from each
location to the next?
Convert the "velocity" of the tank from pixels
per minute to pixels per second.
1 minute = 60 seconds
83.33
pixels per minute / 60 seconds per minute = 1.38 pixels per second
Assuming
that the velocity is the minimum refreshes per second, then the screen needs
to refresh 1.38 times per second. So you can skip 8.68 refreshes per second.
"But skipping 8.68 refreshes makes no sense in the real world -- you can skip
8 or 9, but not 8.68," says Baldwin. So convert 8.68 to an integer: 8. The
computer can do less work by recalculating the tank's position 2 times per
second instead of 10.
Computer game designers work to optimize the
amount of work that a computer has to do, making the game faster and more
efficient. And math plays an important role in this. "Math is the tool for
managing these models," says Baldwin.