Game Development Reference
In-Depth Information
T
ILTING THE
P
ARABOLA
By adding the value of
x
without an exponent, we can “tilt� the parabola one direc-
tion or the other. For example, assuming
x
> 0, the following formula will tilt the
parabola slightly to the left:
By adding a coefficient to the first-degree component (the one without an ex-
ponent), we determine the magnitude of the effect. For example, the formula
generates a parabola that tilts significantly further to the left than does the one
from the original equation above (Figure 10.3).
FIGURE 10.3
By adding a first-degree component to the otherwise
second-degree function, we can “tilt� the parabola. In this case, the addition
of 10
x
to the basic parabola tilted the curve to the left.
Note that the addition of other components will also change the vertex loca-
tions much like the inclusion of the
b
and
c
parameters. In the case of the formula
in Figure 10.3, the new vertex is at (-5, -25). When
x
= -5, the original
x
2
portion
of the equation still wants to be at
y
= 25. The new 10
x
portion yields a -50, how-
ever, which pushes that side of the curve down. Similarly, positive values of
x
push
the right side of the curve
up
by adding 10
x
to it—thus the “tilt� effect. Note that
you can't tilt the parabola such that you can have two
y
values for the same
x
value.
(Parabolas wobble, but they don't fall down!)