Beginning Math and Physics for Game Programmers
< Day Day Up > |
Parabolas
Think about the last time you threw a baseball or kicked a soccer ball. Did it follow a straight-line path through the air? No, it probably had more of a curved or arclike path. In fact, any projectile follows what is called a parabolic path. A parabola is really just a fancy name for a symmetric bump, or arc. The bump can be upside-down or sideways , as shown in Figure 2.5, but one side is always a mirror image of the other. Figure 2.5. Four different types of parabolas.
You will use two components of the parabola to determine its equation. The first is the vertex , which is the very tip of the bump. The second is the axis of symmetry , which goes through the vertex and splits the parabola right down the middle so that each side is a reflection of the other. There are actually two forms for the equation of a parabolaone for the up-and-down version with a vertical axis of symmetry, and one for the sideways version with a horizontal axis of symmetry.
NOTE The term vertex is also used in the context of polygonal modeling. Don't confuse that type of vertex with this one, which is more like the apex of a curve. Also, both forms use ( h,k ) for the vertex, but notice that the positions of h and k in the actual equations switch. Finally, note that the axis of symmetry is either a horizontal or vertical line that always goes through the vertex.
When making a rough sketch of a parabola, you must consider two additional features. First, if the equation is in the form y = a ( x h ) 2 + k , the parabola opens either up or down. If it looks like x = a ( y k ) 2 + h , it opens sideways. Notice in the up-and-down version that you can plug in different values for x and then solve for y . In the sideways version, you interpolate along the y-axis and solve for x . Second, the constant a determines in which direction the parabola opens and how wide or skinny the opening is. If a is a positive number, the parabola opens up if it looks like y = a ( x h ) 2 + k or opens to the right if it's x = a ( y k ) 2 + h . If a is negative, the parabola opens downward or to the left. Also, the closer a gets to 0, the wider the opening. Likewise, the farther a gets from 0 (positive or negative), the skinnier the opening. These are just some tips to help you estimate where a parabola will fall and how to make adjustments to model whatever you like. Example 2.6: Sketching a Parabola
Roughly sketch the parabola y = ( 1/3 )( x 2) 2 + 3. Solution
Example 2.7: Sketching Another Parabola
Roughly sketch the parabola x = y 2 + 5. Solution
Now that you are familiar with the parabolic equation, you can use it to model a projectile's motion path. Graphing it precisely is not nearly as important as knowing how to adjust the equation to fit your needs. Plenty of shareware programs available online will graph the parabolic equation for you if you want to see the precise graph. What is more important for you is knowing how to modify the equation to fit your needs. Think about what values you might plug into the equation to model a line drive versus a pop fly in a baseball game. Chapter 10, "Motion in Two and Three Dimensions," looks more closely at how to model a projectile's motion with a parabolic equation. Perhaps you know an object's starting point and initial velocity, and you want to track its height as it travels horizontally. The parabolic equation will track it for you! Self-Assessment
Give the vertex of the following parabolas:
Sketch the graph of the following parabolas:
|
< Day Day Up > |