Game Development Reference
In-Depth Information
Figure 9.8
A negative value creates a difference of two terms and shifts the vertex to the left.
Translating to the Left
If you again rewrite the expression
ax
2
so that
x
can be defined by the difference
of two values, you arrive at an expression that reads
aðx hÞ
2
. If you then
substitute a negative value for
h
, you end up with an expression that appears as
aðx ðhÞÞ
2
. Figure 9.8 illustrates a situation in which you use a negative value
in a quadratic equation in this way. The basic effect of this operation is the same
as if you carried out an addition of the form
ðx þ hÞ
2
. The result in the graph is
that the vertex of the parabola is shifted to the left of the origin on the
x
axis by
4 units.
As with the previous example, the position of the vertex is defined by a coor-
dinate pair in which the value of the first coordinate is 0. In this instance, the
value of the second coordinate is a negative number (
0
,-4). The location of the
line of symmetry on the
x
axis is the value of -4. As in the previous example, since
the value of
a
is positive, the parabola opens upward.
Inverting and Translating
As you might expect, no restriction prevents you from both inverting and
translating a parabola. To accomplish this, you set the slope value (
a
)toa
negative number. As in the previous sections, you can also continue to substitute
the expression
x h
for
x
to shift the vertex along the
x
axis. For example, if you