You are on page 1of 9

CHAPTER 5

Affine morphisms

Contents
5.1 Changing coordinate systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
5.2 Affine morphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5.3 Projections and reflections in a hyperplane . . . . . . . . . . . . . . . . . . . . . . . . 4
5.3.1 Tensor products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5.3.2 Parallel projection on a hyperplane . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.3.3 Parallel reflection in a hyperplane . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Let φ : V → W be a linear map between the R-vector spaces V and W . Let v = {v1 , . . . , vn } be a
basis for V and let w = {w1 , . . . , wm } be a basis for W . In your Algebra course, you used the notation
[φ]v,w for the matrix of the linear map φ with respect to the bases v and w. We will use the notation
Mw,v (φ) = [φ]v,w
Notice that the indices v, w are reversed.
You have also learned that if ψ : W → U is another linear map, to some vector space U with basis
u = {u1 , . . . , uk }, then
Mu,v (ψ ◦ φ) = Mu,w (ψ) · Mw,v (φ).
In particular if V = W then
Mw,w (φ) = Mw,v (IdV ) · Mv,v (φ) · Mv,w (IdV ) = Mv,w (IdV )−1 · Mv,v (φ) · Mv,w (IdV ).
So, the matrix of φ with respect to the basis w is obtained from the matrix of φ with respect to the
basis v by conjugating with the matrix Mv,w (IdV ). We call the matrix Mv,w := Mv,w (IdV ) the change of
basis matrix from the basis w to the basis v. If K and K′ are two coordinate systems, we write MK,K′ for
the base change matrix w.r.t. the corresponding bases.

1
Geometry - first year - IE iulian.simion@ubbcluj.ro

5.1 Changing coordinate systems


Example (In dimension 2). Let K = Oij and K′ = O′ i′ j′ be two coordinate systems (reference frames)
of E2 . Suppose that we know O′ , i′ and j′ relative to K:
" # " # " #
′ 7 ′ −2 ′ 1
[O ]K = , i = −2i + j = , j = i + 2j = .
−1 K 1 K 2 K
How can we translate the coordinates of points from K to K′ ?

A
j C j′
O i i′
O′

We can do this in two steps: (a) first we change the origin, i.e. we go from Oij to O′ ij and (b) we
change the directions of the coordinate axes, i.e. we go from O′ ij to O′ i′ j′ . The first step is just a
translation and the second step corresponds to the usual base change from linear algebra.

B B

A A
j j′
C C
j j
Oi i′
O′ i Oi
(a) Change the origin. (b) Change the direction of the axes.

For the first step


−−−→ −−−→ −−−→ −−−−→
[ O′ A ]K′ = [ O′ A ]K = [ OA ]K − [ OO′ ]K .
For the second step let MK,K′ denote the base change matrix from the basis in K′ to the basis in K.
Then
−−−→ −−−→ −−−→ −−−→
[ OA ]K = MK,K′ [ OA ]K′ and [ OA ]K′ = MK′ ,K [ OA ]K .
Hence composing the two operations, (a) and (b), we obtain
−−−→ −−−→ −−−−→ −−−→ −−−−→ −−−→ −−−−→
[ OA ]K′ = MK′ ,K ([ OA ]K − [ OO′ ]K ) = MK′ ,K [ OA ]K − MK′ ,K [ OO′ ]K = MK′ ,K [ OA ]K − [ OO′ ]K′

2
Geometry - first year - IE iulian.simion@ubbcluj.ro

Hence, the formula for changing coordinates from the system K to the system K′ is

[A]K′ = MK′ ,K ([A]K − [O′ ]K ) = MK′ ,K [A]K + [O]K′ (5.1)

Suppose now that a point A is given and that the coordinates of A in the frame K (relative to the
coordinate frame/coordinate system K) are (1, 2). Then the coordinates of A relative to K′ are
" #
1
[A]K′ = MK′ ,K + [O]K′
2 K

Since we know i′ and j′ with respect to i and j, we can write down the matrix MK,K′ and then MK′ ,K =
M−1 ′
K,K′ . Since we know the coordinates of O with respect to K, it is more convenient to use the first
equality in (5.1)
" #−1 " # " # ! " # " # " # ! " #
−2 1 1 7 1 2 −1 1 7 3
[A]K′ = · − = · + = .
1 2 2 K −1 K −5 −1 −2 2 K −1 K 0

Theorem 5.1. Let K = Oe1 . . . en and K′ = O′ f1 , . . . , fn be two coordinate systems of En . Denote by


e = {e1 , . . . , en } and by f = {f1 , . . . , fn } the two bases of Vn . Let MK′ ,K be the change of basis matrix from
the basis e to the basis f and let MK,K′ be the change of basis matrix from the basis f to the basis e.
For any point P ∈ En we have

[P ]K′ = MK′ ,K ·([P ]K − [O′ ]K ) = M−1 ′


K,K′ ·([P ]K − [O ]K ) = MK′ ,K ·[P ]K + [O]K′ . (5.2)

Example (In dimension 3). Let K = Oijk and K′ = O′ i′ j′ k′ be two coordinate systems (reference
frames) of E3 . Suppose that we know O′ , i′ , j′ and k′ relative to K:
       
 4  −1 −2 0
[O′ ]K =  5  , i′ = −i − 2j = −2 , j′ = −2i + j =  1  , k′ = j + 2k = 1 .
       
−1 K 0 K 0 K 2 K
       

The coordinates with respect to K′ can be obtained from the coordinates with respect to K in two
steps:

3
Geometry - first year - IE iulian.simion@ubbcluj.ro

(a) Change the origin. (b) Change the direction of the axes.

If B is the point with coordinates (1, 5, 1) with respect to K, then


 −1            
−1 −2 0 1  4  −2 −4 2  1  4  1
     1 
[B]K′ = M−1 ′
K,K′ ·([B]K − [O ]K ) = 
−2 1 1 5 −  5  =
     10 −4 2 −1 5 −  5  = 1 .
       
       

0 0 2 1 −1 0 0 5 1 −1 1

5.2 Affine morphisms


Definition. An affine morphism φ : En → Em is a map which relative to some reference frame K of
En and some reference frame K′ of Em can be expressed as

[φ(P )]K′ = A · [P ]K + b (5.3)

with A ∈ Matm×n (R) and b ∈ Matm×1 (R).

• In (5.3) both A and b depend on the choice of the coordinate systems K and K′ .

• If n = m, so, if φ : En → En then φ is called an affine endomorphisms. The set of all such


endomorphisms is denoted by Endaff (En ).

• The morphism φ is invertible if and only if the matrix A is invertible.

• If n = m and φ is invertible then φ is called an affine automorphism or affine transformation. The


set of all affine transformations of En is denoted by AGL(En )

• If K = K′ in (5.3) and b is the zero vector, then φ is a linear map. In particular

GL(Vn ) ⊆ AGL(En ).

5.3 Projections and reflections in a hyperplane


Definition. A hyperplane in En is a subset of points H satisfying a linear equation,

H : a1 x1 + · · · + an xn + an+1 = 0

with respect to some coordinate system Oe1 . . . en .

4
Geometry - first year - IE iulian.simion@ubbcluj.ro

• Hyperplanes in E2 are lines.

• Hyperplanes in E3 are planes.

• Consider a line ℓ ⊆ En passing through a point Q(q1 , . . . , qn ) and having v(v1 , . . . , vn ) as direction
vector:
ℓ = {Q + tv : t ∈ R}. (5.4)
Consider a hyperplane H ⊆ En given by the Cartesian equation

H : a1 x1 + · · · + an xn + an+1 = 0 (5.5)

The intersection ℓ ∩ H can be described as follows

Q + tv ∈ ℓ ∩ H ⇔ a1 (q1 + tv1 ) + · · · + an (qn + tvn ) + an+1 = 0

So, the intersection point (if it exists) is


a1 q1 + · · · + an qn + an+1
Q′ = Q − v. (5.6)
v1 q1 + · · · + vn qn

5.3.1 Tensor products


Definition. Let v(v1 , . . . , vn ) and w(w1 , . . . , wn ) be two vectors. The tensor product v ⊗ w is the n × n
matrix defined by (v × w)ij = vi wj . In other words

v1  h v w ... v1 wn 
   
 .  i  1 . 1 ..  .
t
v ⊗ w = v · w =  ..  · w1 , . . . , wn =  .. . 
  
vn vn w1 . . . vn wn

Proposition 5.2. The map Rn × Rn → Matn×n (R) given by (v, w) 7→ v ⊗ w has the following properties:

1. It is linear in both arguments,

2. (v ⊗ w)t = w ⊗ v.

• The tensor product of two vectors is also called outer product - to be compared with the inner
product which is
w
 
h i  .1 
t
⟨v, w⟩ = v · w = v1 , . . . , vn ·  ..  = v1 wn + · · · + vn wn .

 
wn

• It is easy to show that for three vectors u, v, w ∈ Vn we have

(u ⊗ v)w = (v · w)u.

5
Geometry - first year - IE iulian.simion@ubbcluj.ro

5.3.2 Parallel projection on a hyperplane


Definition. Let H be a hyperplane and let v be a vector in Vn which is not parallel to H. For any
point P ∈ En there is a unique line ℓP passing through P and having v as direction vector. The line ℓP
is not parallel to H, hence, it intersects H in a unique point P ′ . We denote P ′ by PrH,v (P ) and call it
the projection of the point P on the hyperplane H parallel to v. This gives a map

PrH,v : En → En

called, the projection on the hyperplane H parallel to v.

• With respect to the reference frame K, the hyperplane H has an equation as in (5.5).

ϕ(P )
• By (5.6), PrH,v (P ) = P − lin ϕ(v) v where φ(P (p1 , . . . , pn )) = a1 p1 + · · · + an pn + pn+1 .

• Hence, if we denote by p1′ , . . . , pn′ the coordinates of the projected point PrH,v (P ) then
 ′

 p1 = p1 + µv1

 .. a1 p1 + · · · + an pn + an+1
where µ = − .



 . a1 v1 + · · · + an vn
 p′ = p + µv

n n n

• In matrix form, we can rearrange this as follows


 ′ Pn,i,1  
 i=1 ai vi −a2 v1 −a3 v1 ... −an v1
 
p1  Pn,i,2
 p1  v1 
 ′     
p2   −a1 v2
i=1 ai vi −a3 v2 ... −an v2  p2  v2 
 
  = 1 an+1 
 ..    ..  −
  .  lin ϕ(v)  ... 
   
.. ..
 
 .  lin ϕ(v) 

 ′  . .     
 Pn,i,n
pn −a1 vn −a2 vn ... −an−1 vn a i vi
 p
n vn
i=1
| {z }
lin PrH,v

6
Geometry - first year - IE iulian.simion@ubbcluj.ro

• It is possible to give a more compact description of the above matrix form if we use tensor
products:  
 
1 a
(v · a) Idn − v · a  · [P ]K − n+1 [v]K
 t t

[PrH,v (P )]K =
lin ϕ(v)   |{z} 
 lin ϕ(v)
v⊗a

where a = (a1 , . . . , an )t .

• If we further notice that lin ϕ(v) = vt · a then

v · at
!
a
[PrH,v (P )]K = Idn − t · [P ]K − tn+1 [v]K
v ·a v ·a

• Parallel projections on hyperplanes are affine morphisms. Obviously, they are not bijective, so

PrH,v ∈ Endaff (En ) but PrH,v < AGL(En ).

5.3.3 Parallel reflection in a hyperplane


Definition. Let H be a hyperplane and let v be a vector in Vn which is not parallel to H. For any
point P ∈ En there is a unique point P ′ such that PrH,v (P ) is the midpoint of the segment [P P ′ ]. We
denote P ′ by RefH,v (P ) and call it the reflection of the point P in the hyperplane H parallel to v. This
gives a map
RefH,v : En → En
called, the reflection in the hyperplane H parallel to v.

• With respect to the reference frame K, the hyperplane H has an equation as in (5.5).

• Since PrH,v (P ) is the midpoint of the segment [P P ′ ], with respect to K we have

ϕ(P ) [P ]K + [P ′ ]K ϕ(P )
[P ]K − [v]K = ⇔ 2[P ]K − 2 [v] = [P ]K + [P ′ ]K .
lin ϕ(v) 2 lin ϕ(v) K

7
Geometry - first year - IE iulian.simion@ubbcluj.ro

Therefore
ϕ(P )
[RefH,v (P )]K = [P ]K − 2 [v] .
lin ϕ(v) K

• As in the case of PrH,v , it is possible to give a compact description of the matrix form if we use
tensor products:
v⊗a a
 
[PrH,v (P )]K = Idn −2 t · [P ]K − 2 tn+1 [v]K
v ·a v ·a
where a = (a1 , . . . , an )t .

• Parallel reflections in hyperplanes are affine morphisms. Obviously, they are bijective, so

RefH,v ∈ AGL(En ) ⊆ Endaff (En ).

5.4 Applications
• [Changing reference frames] Changing coordinates is so common in real life applications that
it is impossible to do any meaningful modeling without coordinate changes. Take for example
the OpenGL-pipeline (a process under which objects are rendered on the screen in order to
simulate a 3D scene). In this process there are two dimensional changes of coordinates for in-
stance when a PNG-image is transformed into an OpenGL-texture, or when an OpenGL texture
is translated into device coordinates before being displayed on the screen.

(b) World space.

(a) Model space.

Three dimensional changes of coordinates are needed in the OpenGL-pipeline as well as in


any modeling software (like Blender or Maya). Complex 3D-models are constructed by several
people, even several teams. The different pieces are constructed separately, each in its own
coordinate system. When they are ready, the whole object is assembled by putting all pieces
in a common coordinate system. In this context one calls the coordinate system of a single
piece ‘model space’ and the coordinate system where the whole object is placed in, is called the
‘world space’. This is important when modeling machines such as spacecrafts or cars. It is also

8
Geometry - first year - IE iulian.simion@ubbcluj.ro

important when constructing computer games. As an example, above is Suzanne, the Blender
monkey.

• [Projecting] There are two main types of algorithms which project a 3D scene in computer
graphics: ray-tracing algorithms and rasterization algorithms. Ray-tracing algorithms intersect
rays with planes determined by the triangles in the scene while rasterization algorithms try to
project the triangles on the display screen.

(b) Rasterization.
(a) Ray-tracing.

It is clearly much more efficient to construct a projection map like PrH,ℓ and project all the
triangles, however, this only works for parallel projections. In order to simulate perspective,
rasterization algorithms use a projective transformation before using a projection like the one
described in the previous paragraphs. Ray-tracing algorithms are conceptually much simpler
but they are much more resource intensive.

You might also like