Game Development Reference
In-Depth Information
The overall pattern assumes a value of 0 at the origin—which represents an angle
of 0. If you move to the right, allowing the
x
axis to map the increase of the value
of the angles, the resulting sine values using the
y
coordinate increase to 1. This
occurs when you reach the
x
value of
2
. As you move past
2
, the value of the sine
decreases, reaching 0 when you are at
, the
value of the sine drops into the negative range. When you reach
3
2
, the value on
the
y
axis is
1. This represents the lowest point. After that, the value begins to
rise, and at 2
on the
x
axis. As you move past
you are back at 0. The name usually applied to this pattern is
sinusoidal. It is a periodic pattern that evenly fluctuates from 1 to
1 for each
distance of 2
represented by the
x
axis.
Negative Values
Figure 12.15 involves negative values on the
x
axis. The negative values reflect the
fact that angles can be negative. When an angle is negative, the direction you
move on the perimeter of the circle is in a counterclockwise direction. In this
situation, you measure angles and radians just as you would if you moved in a
clockwise direction, except that the value of
2
ð
90
8Þ
is found on the lower part
3
2
ð
180
of the
y
axis, while
8Þ
is found on the upper part. Figure 12.16 illus-
trates a few negative angles you encounter as you move along a negative arc of a
unit circle.
Plotting Cosine Values
As Figure 12.17 illustrates, when you plot cosine values using a Cartesian plane,
plot angle values on the
x
axis, and move to the right to show increasing values of
angles, the resulting
y
coordinate value is 1 when the angle of your circle is 0.
When you reach
2
(90
), the value of the
y
coordinate value drops to 0. From
there, as you move past
2
, the value of the cosine decreases, reaching
1 when
you are at
8
. As you move past
,
the value of
the cosine begins to
2
. After that, the value begins to rise, and at 2
3
increase, reaching 0 again at
you are back at 1.
The same pattern characterizes movement in the negative direction along the
x
axis. As Figure 12.17 illustrates, at
2
, the value of the cosine falls to 0. From
there, it proceeds further downward to
1at
3
2
, the values
. As you move to
of the cosine increase, and at
2
you are back to 1.