Game Development Reference
In-Depth Information
the value of the slope (
m
) to 1 and the value of the intercept (
b
) to 0, then you
generate a line that crosses the
y
axis at 0. If the value of
m
is positive, then the line
slopes up and to the right of the
y
axis.
When you set the slope (
m
) to 1, you multiply the value of the domain (
x
)by1,so
as you move into quadrant I, for each unit on the
x
axis, you generate a corre-
sponding and equal unit on the
y
axis. For example, when the line with slope 1
reaches the dashed graph line for the value of 4 on the
x
axis, it also reaches the
dashed graph line for the value of 4 on the
y
axis.
The situation changes when you set the slope (
m
) to 4. When you set the slope
to 4, then each unit in a positive direction on the
x
axis corresponds to a
movement of 4 units on the
y
axis. In the Cartesian plane Figure 6.2 illustrates,
you increase the value of the slope until you reach 8, at which point the ''rise'' of
the line has progressed at a rate of 8 units for every 1 unit in the ''run'' (1, 8). At
this point, you are out of room for expansion. Given a larger coordinate system,
you could continue to increase the slope indefinitely.
In the same way, when you set the slope to
2
, then for each unit on the
x
axis, you
find only half a unit on the
y
axis. When the line with a slope of
2
reaches the
dashed line for the value of 6 on the
x
axis, it has climbed only to the value of 3 on
the
y
axis (3, 6). The larger the value of the denominator of the slope, the smaller
the rise of the line. For a slope of
1
8
, for example, when the line reaches the
dashed line corresponding to the value of 8 on the
x
axis, you find that it has
climbed only to 1 on the
y
axis (8, 1).
y-Intercept
As mentioned previously, the constant
b
in the slope-intercept equation
designates the point at which the line crosses the
y
axis of the Cartesian plane.
Figure 6.3 illustrates lines with the same slopes as shown in Figure 6.2. In this
instance, however, you change the value of the y-intercept (
b
). When you
assign a value other than 0 to the y-intercept, the line no longer crosses the
x
axis at its origin. When you set the y-intercept to a positive value, it crosses
the
y
axis above the
x
axis.
When you set the value of the y-intercept (
b
) to 4 in Figure 6.3, the line crosses the
y
axis at 4. When you set it at 2, it crosses the
y
axis at 2. For the line with a slope
of
2
, when you set the y-intercept value (
b
) to 1, then you shift the line upward
by 1, so it crosses at 1. In each chase, changing the y-intercept does not alter the
slope of the line. It affects only the position at which the line crosses the
y
axis.