Graphics Reference
In-Depth Information
Another way is to compute
x
1
y
1
1
x
2
y
2
1
x
3
y
3
1
which is twice the area of ∆
P
1
P
2
P
3
. If this equals zero, the points must be
collinear.
12.9 Find the Position and Distance of the Nearest Point
on a Line to a Point
Suppose we have a line and some arbitrary point
P
, and we require to find
the nearest point on the line to
P
. Vector analysis provides a very elegant way
to solve such problems. Figure 12.8 shows the line and the point
P
and the
nearest point
Q
on the line. The nature of the geometry is such that the line
connecting
P
to
Q
is perpendicular to the reference line, which is exploited
in the analysis.
The objective is to determine the position vector
q
.
We start with the line equation
ax
+
by
+
c
=0
and declare
Q
(
x, y
) as the nearest point on the line to
P
.
Thenormaltothelinemustbe
n
=
a
i
+
b
j
and the position vector for
Q
is
q
=
x
i
+
y
j
therefore
.
n
q
=
−
c
(12.1)
Y
n
Q
q
r
P
p
O
X
Fig. 12.8.
Q
is the nearest point on the line to
P
.