Graphics Reference
In-Depth Information
12
Worked Examples
This chapter examines a variety of problems encountered in computer graphics
and develops mathematical strategies for their solution. Such strategies may
not be the most e
cient, however, they will provide the reader with a starting
point, which may be improved upon.
12.1 Calculate the Area of a Regular Polygon
Given a regular polygon with
n
sides, side length
s
, and radius
r
of the cir-
cumscribed circle, its area can be computed by dividing it into
n
isosceles
triangles and summing their total area.
Figure 12.1 shows one of the isosceles triangles
OAB
formed by an edge
s
and the centre
O
of the polygon. From Figure 12.1 we observe that
=tan
π
n
1
2
s
h
therefore
2
s
cot
π
h
=
1
n
4
s
2
cot
π
area ∆
OAB
=
1
2
sh
=
1
n
but there are
n
such triangles, therefore
4
ns
2
cot
π
area =
1
n