Graphics Reference
In-Depth Information
(averaging the x -coordinates and then averaging the y -coordinates) we get M =
( 3, 3 ) , which turns out to be the midpoint of the segment between them. This is an
interesting situation: The midpoint is defined purely geometrically, independent of
coordinates. But we've got a formula, in coordinates, for computing it. Suppose
we look at the coordinates of P and Q in the blue coordinate system, which is
rotated 45 from the black one, and has its origin to the right and below, and
average those: The coordinates are (2, 2) and (2, 4); the average is (2, 3). In the
blue coordinate system, the point ( 2, 3 ) is exactly at the same location as the black
coordinate system point ( 3, 3 ) . In short, while the coordinate computations differ,
the underlying geometric result is the same.
P
P
9
P
0
Figure 7.6: The operation
“divide the coordinates of a
point by two” produces different
results (P and P ) in the two
coordinate systems—this simple
algebraic operation is not inde-
pendent of the coordinate system,
so it doesn't correspond to any
geometric operation.
Contrast this with the operation “divide the coordinates of a point by two”
(Figure 7.6). Under this operation, the point P with black-line coordinates ( 2, 5 )
becomes the point P with coordinates ( 1, 2. 5 ) . But if we apply the same oper-
ation in blue-line coordinates, where P has coordinates ( 4, 7 ) , the new blue-line
coordinates are ( 2, 3. 5 ) , and the point P corresponding to those coordinates is
far from P . What's the difference between the averaging and the divide-by-two
operations? Why does “averaging coordinates” give the same result in any two
coordinate systems, while “dividing coordinates by two” gives different ones?
We'll answer this in greater detail in Section 7.6.4. For now, let's just examine the
distinction algebraically: Let's write down the average of the coordinates of points
( x 1 , y 1 ) and ( x 2 , y 2 ) .It'sjust
M = x 1 + x 2
2
.
, y 1 + y 2
2
(7.17)
If we agree to temporarily define a “multiplication” of a point's coordinates by a
number with the rule
s ( x , y )=( sx , sy ) ,
(7.18)
and addition of points by
( x 1 , y 1 )+( x 2 , y 2 )=( x 1 + x 2 , y 1 + y 2 ) ,
(7.19)
then this averaging can be written
M = 1
2 ( x 1 , y 1 )+ 1
2 ( x 2 , y 2 ) ,
(7.20)
while the “dividing coordinates by two” operation can be written
1
2 ( x , y ) .
(7.21)
The key difference, it turns out, is that the first operation involves summing up
terms where the coefficients sum to one (because 2 + 2 = 1), while the second
does not. A combination where the coefficients sum to one is called an affine
combination of the points, and it is combinations like these that are invariant
when we change coordinate systems. (You should try a few others to convince
yourself of this.)
Since affine combinations have the property of being “geometrically meaning-
ful,” we'll now examine them more closely. Suppose that instead of averaging, we
took a 3
2
3 combination of the points, that is, we computed (for the points P and
Q in Figure 7.5)
1
3 P + 2
3 Q .
(7.22)
 
Search WWH ::




Custom Search