Game Development Reference
In-Depth Information
Figure 9.15
Labeling triangles
For example, let's write the law of sines and law of cosines using this
notation:
sinθ 1
l 1
= sinθ 2
l 2
= sinθ 3
l 3
,
Law of sines
l 1 2 = l 2 2 + l 3 2 − 2l 2 l 3 cosθ 1 ,
l 2 2 = l 1 2 + l 3 2 − 2l 1 l 3 cosθ 2 ,
l 3 2 = l 1 2 + l 2 2 − 2l 1 l 2 cosθ 3 .
Low of cosines
The perimeter of the triangle is often an important value, and is com-
puted trivially by summing the three sides:
p = l 1 + l 2 + l 3 .
Perimeter of a triangle
9.6.2 Area of a Triangle
This section investigates several techniques for computing the area of a
triangle. The most well known method is to compute the area from the
base and height (also known as the altitude). Examine the parallelogram
and enclosed triangle in Figure 9.16.
From classical geometry, we know that the area of a parallelogram is
equal to the product of the base and height. (See Section 2.12.2 for an
explanation of why this is true.) Since the triangle occupies exactly one
half of this area, the area of a triangle, is
A = bh/2.
Area of a triangle
 
Search WWH ::




Custom Search