linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and...

45
GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department of Computer Science, UCL [email protected] http://moodle.ucl.ac.uk/course/view.php?id=11547 GV01 - Mathematical Methods, Algorithms and Implementations: Linear Algebra Part II - Linear Transformations 2 Structure • Introduction • Transformations Linear Transformations • Affine Transformations Matrix Representations of Transformations Developing Some Sample Transformations Composite Transformations 3 Introduction Introduction • Transformations Linear Transformations • Affine Transformations Matrix Representations of Transformations Developing Some Sample Transformations Composite Transformations

Transcript of linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and...

Page 1: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations

Simon Julier

Department of Computer Science, UCL

[email protected]

http://moodle.ucl.ac.uk/course/view.php?id=11547

GV01 - Mathematical Methods, Algorithms and Implementations: Linear Algebra Part II - Linear Transformations

2

Structure

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

3

Introduction

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

Page 2: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

4

Why Transformations?

• In the first set of slides we laid out the linear spaces needed to do linear algebra

• This defines things like vectors, points, geometric objects and bases and the like

• Transformations are the things which actually dosomething useful with those spaces

5

Linear Transformations in Computer Graphics

• Complicated models are often composed of parts which must be:– Scaled– Rotated

– Translated

• Transformations are applied to complete each of these operations

6

Linear Transformations in Computer Graphics

• The transformations are often represented using homogeneous coordinates

• In 2D, these encode points and vectors as

• Operations such as translation and rotation are expressed using matrix multiplication

• It actually turns out that this representation is not a “hack” but is, in fact, a way to implement affine coordinates and affinetransformations

Page 3: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Linear Transformations in Face Recognition

7

Linear Transformations in Face Recognition

• We can’t simply take the absolute value of the differences in pixels– Very sensitive to slight changes in the image

• Normalised ratios between distances of feature points– Difficult to extend to multiple views– Very fragile

• Alternative is to use linear algebra approach– Simple– Robust– Performs automatic relevance detection

8

Constructing a Basis for the Images

• Each image Γi is treated as a single vector of dimension N2

• The training data of M images (for M people) is

• The mean image Ψ is simply the average,

9

Page 4: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Constructing a Basis for the Images

10

Constructing a Basis for the Images

• The difference between each training image and the mean image is

• A set of eigenfaces are computed from the set of difference vectors (how we’ll see later), giving the basis

11

The Basis or Eigenfaces

12

Page 5: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Recognising a Face

• The difference between the input image and the mean image is computed,

• This vector is written as a set of coordinates using E as the basis

where

• Therefore,

13

Recognising a Face

• The Euclidean distance between the sample coordinates and each eigenface is computed,

• The following logic is used:

14

Recognised Face

15

Page 6: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Unrecognised Face

16

Not a Face

17

18

Roadmap of the Material

LinearTransformations

Affine Maps

Transformations

General linear algebra concepts

Specific geometric applications

MatrixRepresentations

SampleTransformations

SampleTransformations

Page 7: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

19

Transformations

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

20

Definition of a Transformation

• Let and be two sets with elements (which could be points, vectors, …)

• A function T from to , maps an input element into an output element

21

Representation of a Transformation

• The “input” set is the domain, and the “output” set the co-domain or range

• Several types of transformations exist

a b c d e

g h i j k

Page 8: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

22

One-to-One Transformations

• Each element from the input set maps to a uniqueelement in the output set

• Note that all the input elements could all map to just a subset of

a b c

g h i j k

23

Onto Transformations

• All the element of map from at least one element of

a b c d e

g h i

24

Isomorphic Transformations

• All the elements of uniquely map to all the elements of • This is the same as T being both one-to-one and onto

a b c d e

g h i j k

Page 9: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

25

Transformation Type Mini-Quiz

26

Transformation Type Mini-Quiz

27

Transformation Type Mini-Quiz

Page 10: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Transformation Type Mini-Quiz

28

Linear Combinations of Transformations

• It is possible to create linear combinations of transformations,

• The type of T(x) can be different from the type of any of the transformations Ti(x)

29

Mini-Quiz

• What kind of transformation is

where

and the domain and range are both the real numbers?

30

Page 11: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Positive and Negative Terms

Summed Solution

Fourier Series

33

Page 12: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

34

Inverse Transformation

• An inverse transformation maps from the range to the domain

• The unique inverse exists for isomorphic transformations

a b c d e

g h i j k

a b c d e

g h i j k

35

Linear Transformations

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

36

Linear Transformations

• These are transformations which map from one vector space to another

• Formally, it is a map

with the following properties:

Page 13: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

37

Illustrating the First Property

• Vectors which close a triangle before the transformation continue to do so afterwards

38

Illustrating the Second Property

• The relative lengths of vectors are preserved

Preservation of Linear Combinations

• These two properties mean that if

then

• Therefore, the effect of a linear transformation can be completely characterised by its effect on the basis vectors

39

Page 14: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Linear Transformation Mini-Quiz

• Let the (orthonormal) basis for (a Euclidean) vector space be

• Suppose

• Describe in words what this transformation does

40

Linear Transformation Mini-Quiz

• Now suppose the transformation is

• Describe in words what this transformation does

41

42

Affine Transformations

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

Page 15: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

43

Affine Transformations (or Maps)

• Affine transformations transform, not surprisingly,affine spaces to affine spaces

• Affine combinations are preserved

where

44

Affine Transformations (or Maps)

• Affine transformations map points to points

• Therefore lines map to lines, planes to planes, etc.

45

Some Types of Affine Transformations

Original Translation Rotation

Reflection Scaling Shearing

Page 16: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

46

Properties Preserved by Affine Maps

• Although it looks like affine maps can do completely arbitrary things, they must preserve three properties:

– Relative ratios– Addition of vector to points

– Parallelism

47

Preservation of Relative Ratios

• Recall that a point on a line can be written as the affinecombination

• By definition, affine maps preserve this affinecombination in the sense

48

Preservation of Relative Ratios

• In other words, the relative distances of R to P and R to Q remain the same

Page 17: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

49

Preservation of Addition of Vectors to Points

• Affine maps preserve the property

• We prove this by first noting that

• Therefore, applying the transformation to both sides gives

Preservation of Addition of Vectors to Points

• Now,

50

51

Preservation of Parallelism

• Affine maps preserve the property that parallel lines remain parallel

Page 18: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

52

Preservation of Parallelism

• To prove this, suppose we have two lines described by the affine combinations

• These lines are parallel if the vector connecting the defining points are proportional to one another, i.e.,

53

Preservation of Parallelism

• Applying the affine transformation to the first line gives:

• In other words, the transformed direction of the line is

54

Preservation of Parallelism

• Now, the affine transformation for line 2 is

• The transformed direction of line 2 is also

Page 19: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Affine Maps Mini Quiz

• What do affine maps do to lines orthogonal to one another?

55

Some Example Transformations

• To develop transformations, we have to ask the questions:– What happens to the points?– What happens to the vectors?

• Examples:– Translation

– Uniform scaling

56

Translation

57

Original Translation

Page 20: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

58

Translation

• Translation causes the position of points to change by an amount

• The frame does not undergo any shearing or rotation and so the relative displacement between points do no change

Translation Mini-Quiz

• What’s the transformation of a vector

• What’s the transformation of the origin point

59

Uniform Scaling

60

Original Scaling

Page 21: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Uniform Scaling

• Uniform scaling about the origin causes the distances between all points to expand by the scale factor s

• Therefore,

61

Uniform Scaling

• What’s the transformation of the origin point

• What’s the transformation of an arbitrary point T(P)?

62

63

Moving from Coordinate-Free to Coordinates

• So far we’ve talked about spaces and transformations in a wholly coordinate free way– This views geometry as a set of abstract geometric objects– However, it’s not very concrete and you can’t implement it

• Now we are going to change gears and look at some of the mathematics of how to implement this– To do this, we have to develop coordinate representations of

points, vectors and transformations

Page 22: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

64

Matrix Representations of Transformations

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

65

Matrix Representation of Vectors

• Recall that in a given a frame, a vector can be written as

• The coordinate axiom says that

• Therefore, the vector can also be written as

66

• This is equivalent to expanding the vector into the product of avector of coefficients with a matrix which encodes the frame,

• Therefore, the coordinate representation of the vector is

Matrix Representation of Vectors

Vector of coefficients

Coordinate frame

Page 23: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

67

Matrix Representation of Points

• Similarly, a point can be written as the origin point plus a vector translation,

68

Matrix Representation of Points

• This can also be written as the product of a vector of coefficients with a matrix which encodes the frame,

• Therefore, the coordinate representation of a point is

Coordinate frame

Vector of coefficients

69

Matrix Representations of Transformations

• We can now express affine transformations in terms of matrix operations

• All the pertinent issues can be considered by looking at the problem of carrying out a change of basis

Page 24: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

70

Matrix Representation of a Change of Basis

• The change of basis involves arbitrary affine transformations including translation, shearing and reflection

71

Affine Transformations and Coordinate Frames

• Formally, each frame is written as

72

Matrix Representation of Affine Transformations

• Applying an affine transformation to a point gives

• Because an affine transformation preserves affinecombinations,

Page 25: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

73

Matrix Representation of Affine Transformations

• Therefore, the transformed point can be written using matrix multiplication in the new frame as

74

Matrix Representation of Affine Transformations

• However, we really want to express our transformed point directly as an updated set of coordinates in the new frame,

75

Affine Transformation of the Vectors

• First consider the effect of the new frame on the basis vectors

• This is simply a case of rewriting the vectors in terms of the new basis set,

Page 26: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

76

Affine Transformation of the Origin Point

• The only transformation which can occur to the origin point is that it undergoes a translation,

• The transformation vector component can also be written in terms of the new basis and so

77

Matrix Representation of Affine Transformations

• Substituting, the matrix representation of the updated point is

• However, this still isn’t quite in the right form because each element of the second matrix is a sum of basis vector terms, not the basis terms individually

78

Matrix Representation of Affine Transformations

• The second matrix can be decomposed into the product of a matrix with the basis for the new frame,

Page 27: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

79

Matrix Representation of Affine Transformations

• Therefore, the final transformation can be decomposed into as,

Coefficients of P in

Transformation matrix

80

Geometric Interpretation of T

• Expanding the transformation matrix,

Transformed basis vectors

of A

Transformed origin of A

81

Geometric Interpretation of T

• Therefore, all affine transformations can be written as

• This probably looks familiar from 2D and 3D homogeneous coordinates, but it works for anynumber of dimensions and any affine transformation

Page 28: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Summary of Matrix Representations

• If we write points and vectors using coordinates in a frame, we recover the familiar homogeneous coordinate representation of vectors and points

• All affine transformations can be written as matrices which act on these coordinates

• The transformation matrices contain two parts:– A transformation of the basis vector

– A translation of the origin point

82

83

Developing Some Sample Transformations

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

84

Deriving Some Specific Transformations

• We’ll derive the following types of transformations from an “affine” perspective (no pun intended):– Translation– Uniform scaling about an arbitrary point

– Orthographic projection– Perspective projection

Page 29: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

85

Matrix Representation of Translation

• Recall that translation causes the position of points to change by an amount

• But vectors are left unchanged

86

Matrix Representation of Translation

• Now, any point can be written as

and its translated position is

Matrix Representation of Translation

• Therefore, we can model a translation as a translation of the origin point only,

87

Page 30: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

88

Matrix Form of the Translation Transformation

• Therefore,

89

Matrix Form of the Translation Transformation

• To express the transformation as a matrix T, we must be able to move the translation term out of the basis and into the matrix itself

• This is achieved by noting that the translation vector itself can be written in terms of the basis,

90

Matrix Form of the Translation Transformation

• This gives us

Page 31: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

91

Matrix Form of the Translation Transformation

• This can be written in the form,

Scaling Mini-Quiz

• What do you think the transformation matrix would look like for the non-uniform scaling operation about a point Q,

92

93

Matrix Form Mini-Quiz

• Suppose Q can be written as,

• Show that the affine transformation matrix is

Page 32: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Uniform Scaling About an Arbitrary Point

• Recall that the effect of a uniform scale about the origin is

• If we scale about an arbitrary point Q, then the term for translation of a point will change, but that of a vector will not

94

Uniform Scaling About an Arbitrary Point

• We know that

• Furthermore,

• Therefore,

95

Matrix Form

• The matrix form is

96

Page 33: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Orthographic Projection

• The orthogonal projection of points and vectors onto a plane

• For a 3D case with orthonormal vectors, this can be defined by a point and a normal vector

97

Orthographic Projection Mini-Quiz

98

Orthographic Projection of Vectors

• From the vector closure properties, we know that

• Since everything is projected onto the plane, we must have

99

Page 34: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Orthographic Projection of Vectors

• Recall that, from the definition of the inner product,

• Therefore,

100

Matrix Form of the Transformation

• We first have to rewrite

as a matrix

• In coordinate form,

101

Matrix Form of the Transformation

• Substituting,

102

Page 35: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Orthographic Projection of Points

• The transformation of T(P) has to put the point on the plane

• From the definition of an affine transformation and using the result we just computed for transforming vectors,

103

Orthographic Projection of Points

• Substituting

we get

104

Matrix Form of the Transformation

• The previous expression tells us how the points move around, but it is not written in terms of the origin and the displacement vectors

• By adding and subtracting the origin point, we can write this as

105

Page 36: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Matrix Form of the Transformation

• Given that

• The transformation of a point becomes

106

Matrix Form of the Transformation

• Therefore,

107

108

Perspective Projection

Page 37: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Perspective Projection (Side View)

109

Perspective Projection

• Perspective projection is not affine because it does notobey the condition

• The reason is that this form assumes that the way vectors are transformed is independent of the position of P in space

• Nonetheless, it ends up producing a “valid” affinecombination

110

Perspective Projection

111

Page 38: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Perspective Projection

112

Perspective Projection (Side View)

113

Computing the Projected Point

• Because the projected point lies on the line which passes through S and P, it must be possible to write the projected point as the affine combination

• We compute α by noting that the vector between Qand T(P) must be perpendicular to the plane normal,

114

Page 39: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Computing the Projected Point

• Substituting,

115

Computing the Projected Point

• Solving for α,

• Finally,

116

The Transformation Matrix

• It can be shown (=somebody else proved it!) that the final form of the transformation matrix is the somewhat scary-looking

• Its lack of affine-ness is shown by the fact that it does not look like matrices we saw earlier

117

Page 40: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

Sample Transformations Summary

• The specific form of the transformation matrix can be deduced by looking at how the transformation affects points and vectors individually

• However, non affine transformations can generateaffine combinations as well

118

119

Composite Transformations

• Introduction

• Transformations

• Linear Transformations

• Affine Transformations

• Matrix Representations of Transformations

• Developing Some Sample Transformations

• Composite Transformations

120

Composite Transformations

• In many problems we can end up having to perform a large number of similar transformations

• One means of implementing this would be to implement each transformation separately

• However, a more efficient strategy is to build a transformation by composing it from other transformations

Page 41: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

121

Composite Transformations

• Suppose we have two transformations,

• We can take the output of T and use it as the input for U

a b c

g h i

122

Composite Transformations

d e f

123

Composite Transformations

• As explained earlier, sometimes its highly desirable to use composition to assemble a transformation from various simple transformations

• This is equivalent to concatenating a series of affinetransformations one after another

• Consider the sequence

Page 42: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

124

Matrix Interpretation of Composition

• Cascading the transformations together,

Coefficients of P in A

Transformation matrix

Transformation matrix

Affine Property of Composite Transformations

• Recall that an affine transformation can be written as

• A second affine transformation can be written as

125

Affine Property of Composite Transformations

• The combined transformation matrix is

• This is obviously affine again

126

Page 43: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

127

Composite Transformation Mini-Quiz

• Use composite transformations to construct the transformation matrix for uniform scaling about a point Q

128

Simple Scaling About A Non-Origin Point

• The composite transformation which achieves this is:

Simple Scaling About A Non-Origin Point

129

Page 44: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

130

Order Matters

• Because matrix multiplication is non-commutative, the order in which we carry out these operations is important

• If we reverse the order of translations, the resulting transformation is

Scaling About A Non-Origin Point

131

Rot Trans vs. Trans Rot

132

Page 45: linear algebra ii - UCL Computer Science - Home · GV01 - Mathematical Methods, Algorithmics and Implementations: Linear Algebra Part II – Linear Transformations Simon Julier Department

133

Inverse Transformation

• Sometimes we want to invert a transformation,

where I(.) is the identity transformation

• In matrix form, we need to compute matrix inverses

• This leads us to systems of linear equations

Summary

• Composite transformations let us cascade multiple transformations together and can be used tosynthesise complicated effects from simple components

• Affine transformations remain affine

• However, the order in which we apply the transformations do matter

• We can define inverse transformations but, to do that, we need to be able to invert matrices

134