| A polygon is constructed from a sequence of vertices (points) as shown in Figure 2.11. A straight line is assumed to link each pair of neighboring vertices; intermediate points on the line are not explicitly stored. There is no convention for starting a chain of vertices, but software will often dictate whether polygons have a clockwise or anti-clockwise vertex sequence. | ![]() |

.

![]() |
Calculate the area of the given triangle ABC and denote it by M. |
![]() |
Calculate the area of the triangle PAB and denote it by A1. |
![]() |
Calculate the area of the triangle PBC and denote it by A2. |
![]() |
Calculate the area of the triangle PAC and denote it by A3. |
![]() |
If P lies inside the triangle, then A1 + A2 + A3 must be equal to M. |
The above equation is useful to analyze the geometric relationships between points and lines.
Given a line with two end points p0, and p1, a test point q is either on or off a given line.
If it is on the line, it is either between the end points, q1, on the backward extension of the line, q2, or on the forward extension, q3 (see figure (2.14). 

| Boundaries of Filled Regions A raster display can show regions of pixels filled with a solid, pattern or texture colors (see figure 2.15). By a region we mean a collection of pixels lying "next to" one another in some fashion or being associated with each other by some common property. The most widely used method in graphics defines a region as the interior of a polygon. |
![]() |
| For each scan line L { Find intersections of L with all edges of Y, then count the number of times the line crosses an edge: If the number of crossings is odd, P is inside If the number of crossings is even, P is outside } |
![]() |
