Linear Transformations Linear Transformations 1 / 21 Linear - - PowerPoint PPT Presentation

linear transformations
SMART_READER_LITE
LIVE PREVIEW

Linear Transformations Linear Transformations 1 / 21 Linear - - PowerPoint PPT Presentation

Linear Transformations Linear Transformations 1 / 21 Linear Transformations A function T from R n R m is called a linear transformation if there exists an m n matrix A such that T ( x ) = A x x R n satisfying the following:


slide-1
SLIDE 1

Linear Transformations

Linear Transformations 1 / 21

slide-2
SLIDE 2

Linear Transformations

A function T from Rn → Rm is called a linear transformation if there exists an m × n matrix A such that T( x) = A x for all x ∈ Rn satisfying the following:

Linear Transformations 2 / 21

slide-3
SLIDE 3

Linear Transformations

A function T from Rn → Rm is called a linear transformation if there exists an m × n matrix A such that T( x) = A x for all x ∈ Rn satisfying the following: T( v + w) = T( v) + T( w), ∀ v, w ∈ Rn T(c v) = cT( v), ∀ v ∈ Rn, c ∈ R

Linear Transformations 2 / 21

slide-4
SLIDE 4

Linear Transformations

A function T from Rn → Rm is called a linear transformation if there exists an m × n matrix A such that T( x) = A x for all x ∈ Rn satisfying the following: T( v + w) = T( v) + T( w), ∀ v, w ∈ Rn T(c v) = cT( v), ∀ v ∈ Rn, c ∈ R Linear transformations preserve lines, unlike nonlinear transformations that may transform a line segment into a parabolic curve, or ellipse

Linear Transformations 2 / 21

slide-5
SLIDE 5

Linear Transformations in 2D

We focus on T from R2 → R2

Linear Transformations 3 / 21

slide-6
SLIDE 6

Linear Transformations in 2D

We focus on T from R2 → R2 A is a 2 × 2 matrix and v is a 2 × 1 column vector.

Linear Transformations 3 / 21

slide-7
SLIDE 7

Linear Transformations in 2D

We focus on T from R2 → R2 A is a 2 × 2 matrix and v is a 2 × 1 column vector. Special examples of linear transformations include:

1

scaling transformations

2

rotations

3

translations

Linear Transformations 3 / 21

slide-8
SLIDE 8

Scaling Transformations

T: R2 → R2 defined by T( v) = c v for c ∈ (0, ∞) c > 1 - dilation by a factor of c c < 1 - contraction by a factor of c In matrix form T x y = c c x y

  • =

cx cy

  • Linear Transformations

4 / 21

slide-9
SLIDE 9

Scaling Transformations

  • 10
  • 8
  • 6
  • 4
  • 2

2 4 6 8 10

  • 10
  • 8
  • 6
  • 4
  • 2

2 4 6 8 10 Scaling

Linear Transformations 5 / 21

slide-10
SLIDE 10

Rotations

Rotations by an angle θ about the origin where the rotation is measured from the positive x-axis in an anticlockwise direction In matrix form, the linear transformation can be represented as: T x y = cos θ − sin θ sin θ cos θ x y

  • Linear Transformations

6 / 21

slide-11
SLIDE 11

Reflections

Reflections about a line L through the origin, e.g. Reflecting a point in R2 about the y-axis: T x y = −x y

  • in matrix form

Linear Transformations 7 / 21

slide-12
SLIDE 12

Reflections

Reflections about a line L through the origin, e.g. Reflecting a point in R2 about the y-axis: T x y = −x y

  • in matrix form

T x y = −1 1 x y

  • Linear Transformations

7 / 21

slide-13
SLIDE 13

Reflections

Reflections about a line L through the origin, e.g. Reflecting a point in R2 about the y-axis: T x y = −x y

  • in matrix form

T x y = −1 1 x y

  • In general, the transformation corresponding to a reflection about the

line L making an angle θ with the positive x − axis is given by A = cos 2θ sin 2θ sin 2θ − cos 2θ

  • =

a b b −a

  • ,

a2 + b2 = 1

Linear Transformations 7 / 21

slide-14
SLIDE 14

Reflection

  • 3
  • 2
  • 1

1 2 3

  • 3
  • 2
  • 1

1 2 3

Linear Transformations 8 / 21

slide-15
SLIDE 15

Shear

y-shear T = 1 a 1

  • x-shear

T = 1 b 1

  • Linear Transformations

9 / 21

slide-16
SLIDE 16

x-shear

T = 1 2.5 1

  • 10
  • 5

5 10

  • 10
  • 8
  • 6
  • 4
  • 2

2 4 6 8 10

Shear

Linear Transformations 10 / 21

slide-17
SLIDE 17

Compositions of transformations

Given two linear transformations T and S both R2 → R2 with T( v) = A v and S( v) = B v ∀ v ∈ R2 then the composition of the transformation T and S, T ◦ S AB

  • T ◦ S
  • (

v) = T

  • S(

v

  • = T
  • B

v

  • = AB

v

Linear Transformations 11 / 21

slide-18
SLIDE 18

Compositions of transformations

Rotation θ = π

8 then reflection about y = 0, then dilation by a factor of 2.

  • 6
  • 4
  • 2

2 4 6

  • 6
  • 4
  • 2

2 4 6

Linear Transformations 12 / 21

slide-19
SLIDE 19

Orthogonal transformations

A linear transformation T : Rn → Rn is called orthogonal if it preserves the length of vectors: ||T( v)|| = || v||, ∀ v ∈ Rn If T( v) = A v is an orthogonal transformation, A is an orthogonal matrix

Linear Transformations 13 / 21

slide-20
SLIDE 20

Orthogonal transformations

A linear transformation T : Rn → Rn is called orthogonal if it preserves the length of vectors: ||T( v)|| = || v||, ∀ v ∈ Rn If T( v) = A v is an orthogonal transformation, A is an orthogonal matrix

1

||A v|| = || v||, ∀ v ∈ Rn

2

The columns of A form an orthonormal basis of Rn

3

ATA = I n

4

A−1 = AT

Linear Transformations 13 / 21

slide-21
SLIDE 21

Orthogonal transformations

A linear transformation T : Rn → Rn is called orthogonal if it preserves the length of vectors: ||T( v)|| = || v||, ∀ v ∈ Rn If T( v) = A v is an orthogonal transformation, A is an orthogonal matrix

1

||A v|| = || v||, ∀ v ∈ Rn

2

The columns of A form an orthonormal basis of Rn

3

ATA = I n

4

A−1 = AT

Orthogonal transformations also preserve dot products of vectors and thus angles are preserved

Linear Transformations 13 / 21

slide-22
SLIDE 22

Random Orthogonal transformations

T= orth(rand(2,2))

  • 3
  • 2
  • 1

1 2 3

  • 3
  • 2
  • 1

1 2 3 Orthorgonal Transformation

Linear Transformations 14 / 21

slide-23
SLIDE 23

Random Transformation

M =

  • 0.8212

0.0430 0.0154 0.1690

  • 3
  • 2
  • 1

1 2 3

  • 3
  • 2
  • 1

1 2 3 Random Transformation

Can this transformation be undone?

Linear Transformations 15 / 21

slide-24
SLIDE 24

Random Transformation

M =

  • 0.8212

0.0430 0.0154 0.1690

  • 3
  • 2
  • 1

1 2 3

  • 3
  • 2
  • 1

1 2 3 Random Transformation

Can this transformation be undone? Yes! det(M) = 0.1381

Linear Transformations 15 / 21

slide-25
SLIDE 25

Random non-invertible Transformation

M = 0.9884 0.3409 0.0000 0.0000

  • 3
  • 2
  • 1

1 2 3

  • 3
  • 2
  • 1

1 2 3 Random Singular Transformation

Linear Transformations 16 / 21

slide-26
SLIDE 26

Affine transformations

These are mappings of the form T( v) = A v + b i.e. affine transformations are composed of a linear transformation (A v) then shifted in the direction b

Linear Transformations 17 / 21

slide-27
SLIDE 27

Affine transformations

These are mappings of the form T( v) = A v + b i.e. affine transformations are composed of a linear transformation (A v) then shifted in the direction b Affine transformations preserve collinearity and ratios of distances. Translations, dilations, contractions,reflections and rotations are all examples of affine transformations.

Linear Transformations 17 / 21

slide-28
SLIDE 28

Affine transformations

T = 1

2

− 1

2

  • +

3 4

  • 6
  • 4
  • 2

2 4 6

  • 6
  • 4
  • 2

2 4 6 Affine Transformations

Linear Transformations 18 / 21

slide-29
SLIDE 29

Affine transformations and fractals

Consider four different linear transformations on points v = (x, y) starting at (0, 0) and one linear transformation performed randomly with different probabilities

85% of the time:

T 1 = A1 v + b1 = 0.85 0.04 −0.04 0.85

  • v +

1.6

  • 7% of the time:

T 2 = A2 v + b2 = 0.20 −0.26 0.23 0.22

  • v +

1.6

  • 7% of the time:

T 3 = A3 v + b3 = −0.15 0.28 0.26 0.24

  • v +

0.44

  • 1% of the time:

T 4 = A4 v = 0.16

  • v

Linear Transformations 19 / 21

slide-30
SLIDE 30

Exercise: Affine transformations and fractals - Implementation notes

Use randsample(4,1,true,[0.85 0.07 0.07 0.01]) to generate random integers with weights Starting with the origin apply a transformation based on the outcome from randsample, (a switch statement may be useful here). plot each point after applying the transformation - use drawnow to visualize the points as they are computed.

Linear Transformations 20 / 21

slide-31
SLIDE 31

Affine transformations and fractals

Linear Transformations 21 / 21