Game Development Reference
In-Depth Information
To compute the circumcenter, we first define the following intermediate
values:
d 1 = − e 2 e 3 ,
d 2 = − e 3 e 1 ,
d 3 = −
e 1
e 2 ,
c 1 = d 2 d 3 ,
c 2 = d 3 d 1 ,
c 3 = d 1 d 2 ,
c = c 1 + c 2 + c 3 .
With those intermediate values, the barycentric coordinates for the circum-
center are given by
c 2 + c 3
2c
, c 3 + c 1
2c
, c 1 + c 2
2c
;
thus, the circumcenter is given by
c Circ = (c 2 + c 3 ) v 1 + (c 3 + c 1 ) v 2 + (c 1 + c 2 ) v 3
2c
.
The circumradius is given by
(d 1 + d 2 )(d 2 + d 3 )(d 3 + d 1 )/c
2
r Circ =
.
The circumradius and circumcenter solve the problem of finding a circle
that passes through three points.
9.7
Polygons
This section introduces polygons and discusses a few of the most important
issues that arise when dealing with polygons. It is di cult to come up with
a simple definition for polygon, since the precise definition usually varies
depending on the context. In general, a polygon is a flat object made up
of vertices and edges. The next few sections will discuss several ways in
which polygons may be classified.
Section 9.7.1 presents the difference between simple and complex poly-
gons and mentions self-intersecting polygons. Section 9.7.2 discusses the
difference between convex and concave polygons. Section 9.7.3 describes
how any polygon may be turned into connected triangles.
 
Search WWH ::




Custom Search