Graphics Programs Reference
In-Depth Information
must therefore satisfy
a x + x
2
+ b y + y
2
+ c =0 .
(1.11)
Equations (1.10) and (1.11) can easily be solved for x and y .Thesolutionsare
P =( x ,y )= x
2 a ( ax + by + c )
a 2 + b 2
2 b ( ax + by + c )
a 2 + b 2
,y
= ( b 2
.
a 2 ) x
2 abx +( a 2
b 2 ) y
2 aby
2 ac
,
2 bc
(1.12)
a 2 + b 2
a 2 + b 2
Equation (1.12) is easy to verify intuitively for vertical and for horizontal lines.
When b is zero, the line becomes the vertical line x =
c/a and Equation (1.12) reduces
to
P =( x ,y )= x
,y =
a ,y .
2 a ( ax + c )
a 2
2 c
x
When a =0,thelineisthehorizontal y =
c/b ,andthesameequationreducesto
P =( x ,y )= x, y
= x,
.
2 b ( by + c )
b 2
2 c
b
y
The transformation matrix for reflection about an arbitrary line ax + by + c =0is
directly obtained from Equation (1.12)
b 2
a 2
2 ab
0
.
a 2
b 2
T =
2 ab
0
(1.13)
1
a 2 + b 2
2 ac
2 bc
Its determinant is
det T = ( b 2
a 2 )( a 2
b 2 )
4 a 2 b 2
a 4 +2 a 2 b 2 + b 4
a 2 + b 2
( a 2 + b 2 ) ,
=
=
a 2 + b 2
which equals
1 (pure reflection) for lines expressed in the standard form (defined as
thecasewhere a 2 + b 2 =1).
Exercise 1.16: Use Equation (1.12) to obtain the transformation rule for reflection
about a line that passes through the origin.
We turn now to the product of two reflections about the two arbitrary lines L 1 :
ax + by + c =0and L 2 : dx + ey + f = 0 (Figure 1.7a). This product can be calculated
from Equation (1.13) as the matrix product
b 2
a 2
e 2
d 2
2 ab
0
2 de
0
,
2 ab
a 2
b 2
0
2 de
d 2
e 2
0
1
a 2 + b 2
1
d 2 + e 2
2 ac
2 bc
2 df
2 ef
Search WWH ::




Custom Search