Graphics Programs Reference
In-Depth Information
The Trig Functions
Sine, cosine, and tangent are known as the trig functions. All they do is represent
the three ratios of the sides of a right triangle in relation to the angles in the triangle.
Referring to Figure 5.14, the three trig functions are defined as follows:
adjacent
angle
angle
sin(angle) = opposite / hypotenuse
cos(angle) = adjacent / hypotenuse
tan(angle) = opposite / adjacent
opposite
Figure 5.14 Definition of the trig functions
In English we say that the sine of the angle labeled angle is equal to the side opposite
from angle divided by the hypotenuse. The cosine of angle is equal to the side adjacent
(but not the hypotenuse) to angle divided by the hypotenuse. The tangent of angle is
equal to the opposite side divided by the adjacent side.
In an earlier discussion, it was pointed out that the sum of the interior angles of all
triangles is equal to 180 degrees. When we have a right triangle, the two angles that
are not the right angle must then add up to 90 degrees. Again referring to Figure 5.14
above, we see that
sin(angle) = cos(90 - angle)
cos(angle) = sin(90 - angle)
In other words, the sine of one angle in a right triangle is the cosine of the other angle
and vice versa. Later when we graph these functions, we will see that they essentially
create the same curves.
That's all well and good, but how can we use this stuff? Let's begin by taking a look at a
fairly common general situation that will give us some tools to apply in a more specific
exercise to follow. Suppose we have a circle with some known radius r. Let's also sup-
pose that we are at some point on the circle at an angle in degrees named angle from
the x-axis. Typically we might want or need to know what the coordinates (x,y) are of
that point on the circle.
Search WWH ::




Custom Search