Graphics Reference
In-Depth Information
10.2.2 The Hessian Normal Form
Figure 10.19 shows a line whose orientation is controlled by a normal unit
vector
n
=[
ab
]
T
.If
P
(
x
,
y
) is any point on the line, then
p
is a position
vector where
p
=[
xy
]
T
and
d
is the perpendicular distance from the origin
to the line.
Therefore
d
=cos(
α
)
p
and
d
=
p
cos(
α
)
(10.28)
But the dot product
n
·
p
is given by
n
·
p
=
n
p
cos(
α
)=
ax
+
by
(10.29)
which implies that
ax
+
by
=
d
n
(10.30)
and because
n
= 1 we can write
ax
+
by
−
d
= 0
(10.31)
where (
x
,
y
) is a point on the line,
a
and
b
are the components of a unit vector
normal to the line and
d
is the perpendicular distance from the origin to the
line. The distance
d
is positive when the normal vector points away from the
origin, otherwise it is negative.
Let's consider two examples.
Example 1
. Find the equation of a line whose normal vector is [3 4]
T
•
and
the perpendicular distance from the origin to the line is 1.
To begin, we normalize the normal vector to its unit form.
Y
n
d
P
(
x, y
)
a
X
P
Fig. 10.19.
The orientation of a line can be controlled by a normal vector
n
and
distance
d
.