Graphics Reference
In-Depth Information
Y
P
3
P
t
P
2
P
X
Fig. 10.25.
If the point
P
t
is inside the triangle, it is always to the left as the boundary
is traversed in an anti-clockwise sequence.
will create a positive result when tested against the edge equation. In the
following calculations there is no need to ensure that the normal vector is a
unit vector.
To illustrate this in action, consider the scenario shown in Figure 10.26
where we see a triangle formed by the points (1, 1), (3, 1) and (2, 3). With
reference to (10.38) we compute the three line equations:
1. The line between (1, 1) and (3, 1):
0(
x
−
1) + 2(1
−
y
)=0
−
2
y
+ 2 = 0
(10.50)
Y
(2, 3)
(1, 1)
(3, 1)
X
Fig. 10.26.
The triangle is formed from three line equations expressed in the Hessian
normal form. Any point inside the triangle can be found by evaluating the equations.