Graphics Reference
In-Depth Information
Y
ax + by
-
d > 0
ax + by
-
d = 0
ax + by - d < 0
X
Fig. 10.20. The Hessian normal form of the line equation partitions space into two
zones.
Conversely, a point ( x 2 ,y 2 ) which is in the partition opposite to the direction
of the normal vector creates the inequality
ax 2 + by 2
d< 0
(10.35)
This space-partitioning feature of the Hessian normal form is useful in clipping
lines against polygonal windows.
10.2.4 The Hessian Normal Form from Two Points
Given two points ( x 1 ,y 1 )and( x 2 ,y 2 ), we can compute the values of a , b and
d for the Hessian normal form as follows. To begin with, we observe:
y
y 1
y 2
y 1
y
x
=
=
(10.36)
x
x 1
x 2
x 1
therefore
( y
y 1 )∆ x =( x
x 1 )∆ y
(10.37)
and
x 1 y + y 1 x = 0 (10.38)
which is the general equation of a straight line. For the Hessian normal form,
x 2 +∆ y 2 =1
x y
y x
Therefore, the Hessian normal form is given by
x y
y x
( x 1 y
y 1 x )
x 2 +∆ y 2
= 0
(10.39)
Let's test this with an example. Given the following points: ( x 1 ,y 1 )=(0 , 1)
and ( x 2 ,y 2 )=(1 , 0); ∆ x =1 , y =
1.
 
Search WWH ::




Custom Search