next up previous
Next: kk_linear_geom Up: kk_linear_geom Previous: kk_linear_geom

3. The two-point relational form

Suppose we want to find a relational description $ f(x,y) =
0 $ for the line through two given points $ P $ and $ Q $. There is a particular choice of $ f $ that does this nicely. It can be derived in either of two ways.

For the first way, take any third point $ R $, and recall the affine transformation that takes the standard triangle to $ P,Q,R $. Let the determinant of its extended matrix be $ \Delta (P,Q,R) $. By adding the third row to the first two, we get a simpler description. Thus

$ \Delta (P,Q,R) $ $ = $ $ \det
{\left[\begin{array}{cc}(P-R)&0\\  (Q-R)&0\\  R&1\end{array}\right]} $ $ = $ $ \det
{\left[\begin{array}{cc}P&1\\  Q&1\\  R&1\end{array}\right]} $ $ = $ $ \det { \left[\begin{array}{ccc}p
_ 1& p _ 2& 1\\  q _ 1& q _ 2& 1\\  r _ 1& r _ 2&
1\end{array}\right]} $.

Here are some facts about $ \Delta (P,Q,R) $. You have seen the first three; the last two follow from (a).



Proposition 1. For any points $ P,Q,R $ in    R$ ^ 2 $:

(a) the area of the triangle formed by $ P,Q,R $ is $ {\frac{1} {2}} \Delta (P,Q,R) $ in absolute value;

(b) if $ \Delta (P,Q,R) > 0 $ then $ P,Q,R $ have the same orientation as the standard triangle, namely, as you go from $ P $ to $ Q $ to $ R $ and back to $ P $ you are traversing the triangle counterclockwise; equivalently, $ Q $ is to the left of $ P $ as seen from $ R $, just as $ (0,1) $ is to the left of $ (1,0)
$ as seen from the origin;

(c) similarly, if $ \Delta (P,Q,R) < 0 $, then the traversal $ P $ to $ Q $ to $ R $ to $ P $ is clockwise; equivalently, $ Q $ is to the right of $ P $ as seen from $ R $;

(d) $ \Delta (P,Q,R) = 0 $ when $ P,Q,R $ are collinear (lie on a line) and so form only a degenerate triangle of zero area;

(e) $ \Delta (P,Q,R) $ $ = $ $ \Delta (Q,R,P) $ $ = $ $ \Delta (R,P,Q) $ (i.e., $ \Delta $ doesn't change when the three points are permuted cyclically).



By (d), the points $ R $ for which $ \Delta (P,Q,R) $ $ = $ $ 0 $ form the line we're looking for. To emphasize which point is varying, let's put    x$ $ for $ R $:



Proposition 2. The line $ L $ in    R$ ^ 2 $ through two points $ P $ and $ Q $ has equation

$ \Delta (P,Q,$x$ ) $ $ = $ $ 0 $.

Let's call this the two-point relational form of $ L $. To see that the function $ \Delta (P,Q,$x$ ) $ is really affine, expand $ \Delta (P,Q,$x$ ) $ by cofactors of the third row; you get

$ \Delta (P,Q,$x$ ) $ $ = $ $ \det { \left[\begin{array}{ccc}p _ 1&
p _ 2& 1\\  q _ 1& q _ 2& 1\\  x _ 1& y _ 2& 1\end{array}\right]} $ $ = $ $ (p _ 2 - q _ {2}x) + (q _ 1 - p _ {1}y) + (p _ 1
q _ 2 - p _ 2 q _ {1}) $.

The second way of deriving the two-point relational form is to use $ P $ and $ Q $ to make a normal to the desired line $ L $:

For the the normal use $ Q-P $ rotated counterclockwise $ 90 ^\circ $. Thus if $ P = (p _ 1, p _
{2}) $ and $ Q = (q _ 1, q _ {2}) $, let $ [a,b] $ $ = $ $ (q _ 1 - p _ 1, q _ 2 - p _ {2}) {\left[\begin{array}{cc}0&1\\  -1&0\end{array}\right]}
$ $ = $ $ [-(q _ 2 - p _ {2}),q _ 1 - p _ {1}] $. Since $ P $ is on $ L $, $ a p _ 1 + b p _ 2 + c $ $ = $ $ 0 $, so $ c = - (a p _ 1 + b p _ {2}) $ $ = $ $ p _ 1 q _ 2 -p _ 2 q _ 1 $. Thus our affine function is

$ (p _ 2 - q _ {2}x) + (q _ 1 - p _ {1}y) + (p _ 1
q _ 2 - p _ 2 q _ {1}) $, as before.



Note 1. From the second method of deriving the two-point relational form, it is clear that if you walk along the line $ L $ from $ P $ towards $ Q $, the half-plane with $ \Delta (P,Q,$x$ ) > 0 $ will be on your left. This is also clear from (b) of Proposition 1, if you put $ R $ $ = $    x$ $ again.

Note 2. Because the two-point relational form does not involve division, it is especially good for use in a computer without built-in floating-point operations, if you use only integers for coordinate values of points.




next up previous
Next: kk_linear_geom Up: kk_linear_geom Previous: kk_linear_geom
Kirby A. Baker 2002-03-07