6/22/2015©Zachary Wartell 2D Transformations Revision 1.2 Copyright Zachary Wartell, University of...

32
03/25/22 ©Zachary Wartell 2D Transformations Revision 1.2 Copyright Zachary Wartell, University of North Carolina All Rights Reserved Textbook: Chapter 5
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    221
  • download

    0

Transcript of 6/22/2015©Zachary Wartell 2D Transformations Revision 1.2 Copyright Zachary Wartell, University of...

041823copyZachary Wartell

2D Transformations

Revision 12Copyright Zachary Wartell University of North Carolina

All Rights Reserved

TextbookChapter 5

041823copyZachary Wartell

Matrices Change of Coordinates vs Geometric Transform

A

[Mi]A

Matrices can represent a change of coordinates denoted

MAlarrB

Matrices are also useful for representing transformations of geometry denoted

[Mi]A [Mj]A [Mk]A

[Mj]A

041823copyZachary Wartell

Recall Discrete Math 101 Relation Function One-to-one etcbull Relation (Binary)

Domain D

Range R

relation L (on|in) set D (onto|into) set R L = (dr) | d D and r R

onto

in

on

into

041823copyZachary Wartell

Recall Converse Relation

Domain D

Range R

relation L in set D into set R

Domain D (=R)

Range R (=D)

CONVERSE(L) in set D into set R

(rd) CONVERSE(L) iff (dr) L

041823copyZachary Wartell

Recall Function

bull function ndash binary relation where every element d element in the domain D in related to at most one element r in the domain R

Domain D

Range R

Not a Function

Domain D

Range R

A Function

041823copyZachary Wartell

Recall Function One-to-one

bull one-to-one function ndash a function every element r element in the range R in related to at most one element d in the domain D

Not one-to-one

Domain D

Range R

A one-to-one Function

Domain D

Range R

041823copyZachary Wartell

Recall Inverse of Functionbull a 1-to-1 function F has a inverse function F-1

ndash Take F build CONVERSE(F) Since F is 1-to-1 CONVERSE(F) is also function

CONVERSE(F) is a function syn the lsquoinverse existsrsquo F-1 exists F is lsquoinvertiblersquo F is non-singular

Domain D

Range R

A one-to-one Function

D R

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Matrices Change of Coordinates vs Geometric Transform

A

[Mi]A

Matrices can represent a change of coordinates denoted

MAlarrB

Matrices are also useful for representing transformations of geometry denoted

[Mi]A [Mj]A [Mk]A

[Mj]A

041823copyZachary Wartell

Recall Discrete Math 101 Relation Function One-to-one etcbull Relation (Binary)

Domain D

Range R

relation L (on|in) set D (onto|into) set R L = (dr) | d D and r R

onto

in

on

into

041823copyZachary Wartell

Recall Converse Relation

Domain D

Range R

relation L in set D into set R

Domain D (=R)

Range R (=D)

CONVERSE(L) in set D into set R

(rd) CONVERSE(L) iff (dr) L

041823copyZachary Wartell

Recall Function

bull function ndash binary relation where every element d element in the domain D in related to at most one element r in the domain R

Domain D

Range R

Not a Function

Domain D

Range R

A Function

041823copyZachary Wartell

Recall Function One-to-one

bull one-to-one function ndash a function every element r element in the range R in related to at most one element d in the domain D

Not one-to-one

Domain D

Range R

A one-to-one Function

Domain D

Range R

041823copyZachary Wartell

Recall Inverse of Functionbull a 1-to-1 function F has a inverse function F-1

ndash Take F build CONVERSE(F) Since F is 1-to-1 CONVERSE(F) is also function

CONVERSE(F) is a function syn the lsquoinverse existsrsquo F-1 exists F is lsquoinvertiblersquo F is non-singular

Domain D

Range R

A one-to-one Function

D R

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Recall Discrete Math 101 Relation Function One-to-one etcbull Relation (Binary)

Domain D

Range R

relation L (on|in) set D (onto|into) set R L = (dr) | d D and r R

onto

in

on

into

041823copyZachary Wartell

Recall Converse Relation

Domain D

Range R

relation L in set D into set R

Domain D (=R)

Range R (=D)

CONVERSE(L) in set D into set R

(rd) CONVERSE(L) iff (dr) L

041823copyZachary Wartell

Recall Function

bull function ndash binary relation where every element d element in the domain D in related to at most one element r in the domain R

Domain D

Range R

Not a Function

Domain D

Range R

A Function

041823copyZachary Wartell

Recall Function One-to-one

bull one-to-one function ndash a function every element r element in the range R in related to at most one element d in the domain D

Not one-to-one

Domain D

Range R

A one-to-one Function

Domain D

Range R

041823copyZachary Wartell

Recall Inverse of Functionbull a 1-to-1 function F has a inverse function F-1

ndash Take F build CONVERSE(F) Since F is 1-to-1 CONVERSE(F) is also function

CONVERSE(F) is a function syn the lsquoinverse existsrsquo F-1 exists F is lsquoinvertiblersquo F is non-singular

Domain D

Range R

A one-to-one Function

D R

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Recall Converse Relation

Domain D

Range R

relation L in set D into set R

Domain D (=R)

Range R (=D)

CONVERSE(L) in set D into set R

(rd) CONVERSE(L) iff (dr) L

041823copyZachary Wartell

Recall Function

bull function ndash binary relation where every element d element in the domain D in related to at most one element r in the domain R

Domain D

Range R

Not a Function

Domain D

Range R

A Function

041823copyZachary Wartell

Recall Function One-to-one

bull one-to-one function ndash a function every element r element in the range R in related to at most one element d in the domain D

Not one-to-one

Domain D

Range R

A one-to-one Function

Domain D

Range R

041823copyZachary Wartell

Recall Inverse of Functionbull a 1-to-1 function F has a inverse function F-1

ndash Take F build CONVERSE(F) Since F is 1-to-1 CONVERSE(F) is also function

CONVERSE(F) is a function syn the lsquoinverse existsrsquo F-1 exists F is lsquoinvertiblersquo F is non-singular

Domain D

Range R

A one-to-one Function

D R

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Recall Function

bull function ndash binary relation where every element d element in the domain D in related to at most one element r in the domain R

Domain D

Range R

Not a Function

Domain D

Range R

A Function

041823copyZachary Wartell

Recall Function One-to-one

bull one-to-one function ndash a function every element r element in the range R in related to at most one element d in the domain D

Not one-to-one

Domain D

Range R

A one-to-one Function

Domain D

Range R

041823copyZachary Wartell

Recall Inverse of Functionbull a 1-to-1 function F has a inverse function F-1

ndash Take F build CONVERSE(F) Since F is 1-to-1 CONVERSE(F) is also function

CONVERSE(F) is a function syn the lsquoinverse existsrsquo F-1 exists F is lsquoinvertiblersquo F is non-singular

Domain D

Range R

A one-to-one Function

D R

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Recall Function One-to-one

bull one-to-one function ndash a function every element r element in the range R in related to at most one element d in the domain D

Not one-to-one

Domain D

Range R

A one-to-one Function

Domain D

Range R

041823copyZachary Wartell

Recall Inverse of Functionbull a 1-to-1 function F has a inverse function F-1

ndash Take F build CONVERSE(F) Since F is 1-to-1 CONVERSE(F) is also function

CONVERSE(F) is a function syn the lsquoinverse existsrsquo F-1 exists F is lsquoinvertiblersquo F is non-singular

Domain D

Range R

A one-to-one Function

D R

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Recall Inverse of Functionbull a 1-to-1 function F has a inverse function F-1

ndash Take F build CONVERSE(F) Since F is 1-to-1 CONVERSE(F) is also function

CONVERSE(F) is a function syn the lsquoinverse existsrsquo F-1 exists F is lsquoinvertiblersquo F is non-singular

Domain D

Range R

A one-to-one Function

D R

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

2D Transform

bull 2D function that maps points (xy) to points (xy)bull Example

F (xy) (xy+x2)

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Affine Transformations

00 01 02

10 11 12

0 0 1

x a a a x

y a a a y

w w

M

translate (T) ndash preserve area length angles orientationrotate (R) ndash preserve area length anglesscale (S) ndash preserve perpendicularity of axisrigid-bodycongruency ndash (T R) preserve area length anglesuniform scalerdquosimilarityrdquo ndash preserve angles orientation

All affine transformations

preserve linespreserve parallelismpreserve distance ratio (rarrequal spacing)map points to points amp vectors to vectors

Start

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Preserve Lines

l

l

M transforming entire grid

l p = p0 + t (p1-p0 ) rarr l M(p) =M(p0) + t (M(p1)-M(p0))

p0

p1

p

p0

p

p1

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Parallelism

la lb

la

lb

M transforming entire grid

la || lb rarr M(la) || M(lb) = la || lb

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Distance Ratios

l

l

M transforming entire grid

abbc = abbc

a

b

c

a

b c

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Translation

bull add offset vector t to every point

t

(xy) (x+txy+ty)

1 0

0 1

0 0 1

x

y

x t x

y t y

w w

bull matrix form

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Rotate

bull specify pivot point and angle

bull how to rotate (xy) about P through θ ndash algebra assume P is origin

P

θ

Observesin (Φ + θ) = yr cos (Φ + θ) =

xrsin Φ = yr cos Φ = xr

x-axis

(xy)

(xrsquoyrsquo)

Φ

θr

(00)

y-axis

Use double angle formulas

cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ

sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ

Substitute xr = (xr)cos θ - (yr)sin θ

Therefore x = x cos θ - y sin θ

Similarly y = x sin θ + ycos θ

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Rotate about Origin

cos sin 0

sin cos 0

0 0 1

x x

y y

w w

bull matrix form

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

bull uniform scale specified by scale factor s and fixed point p

bull algebra assume scale about origin

x=s x y =s y ie

Scaling Uniform

1s

p

0 0

0 0

0 0 1

x s x

y s y

w w

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

bull specify two scale factors sx and sy and two perpendicular fixed lines

bull algebra assume scale along x and y axis

Scale Differential

0 0

0 0

0 0 1

x

y

x s x

y s y

w w

sxp

sy

B

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Inverse Transforms

bull translate

bull rotate

bull scale

1

1 0

0 1

0 0 1

x

y

t

t

T

cos sin 0 cos( ) sin( ) 0

sin cos 0 sin( ) cos( ) 0

0 0 1 0 0 1

1R

1

10 0

10 0

0 0 1

x

y

s

s

S

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Shear (along XY axis)

1 0

0 1 0

0 0 1

xysh

1 0 0

1 0

0 0 1yxsh

Y Shear (in terms of X)

X Shear (in terms of Y)

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Reflections

1 0 0

0 1 0

0 0 1

1 0 0

0 1 0

0 0 1

X Axis Reflection Y Axis Reflection

1 0 0

0 1 0

0 0 1

Origin Reflection Reflection on y=x

0 1 0

1 0 0

0 0 1

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Composing Transformations

bull Examples

2 1 1 2

2 1 1 2

1 0 1 0 1 0

0 1 0 1 0 1

0 0 1 0 0 1 0 0 1

x x x x

y y y y

t t t t

t t t t

2 1 1 2

2 1 1 2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 1 0 0 1 0 0 1

x x x x

y y y y

s s s s

s s s s

2 2 1 1 2 1 2 1 2 1 2 1

2 2 1 1 2 1 2 1 2 1 2 1

2 1 2 1

cos sin 0 cos sin 0 cos cos sin sin cos ( sin ) sin cos 0

sin cos 0 sin cos 0 sin cos cos sin sin ( sin ) cos cos 0

0 0 1 0 0 1 0 0 1

cos sin 0

sin

2 1 2 1cos 0

0 0 1

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Matrix Composition Non-Communitive

cos sin 0 1 0

sin cos 0 0 1

0 0 1 0 0 1

x

y

t

t

bull Matrix multiplication non-communitive

bull Example

1 0 cos sin 0

0 1 sin cos 0

0 0 1 0 0 1

x

y

t

t

1

2

2

1

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

How do I rotate about arbitrary point p

B[MRot(θ)] B

(33)Bv

A

MRot (θp)

p()Bv

(33)

B

v

[MRot(θ)]A=[MRot(θp)]B

p

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B

( )

( )

( )

1 1

1

1

1

Rot

Rot

Rot

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

( )

( )

1

1 0 cos sin 0 1 0

0 1 sin cos 0 0 1

0 0 1 0 0 1 0 0 1 1

1 0 cos sin cos

0 1

0 0 1

Rot

Rot

x x

y y

x x

y

x

y

p p x

p p y

p p

p

M

M M M A B B

B A A B BA

B

B

sin

sin cos sin cos

0 0 1 1

cos sin cos sin

sin cos sin cos

0 0 1 1

y

x y

x y x

x y y

p x

p p y

p p p x

p p p y

B

B

B

B

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Generally If I know v in B and M in A then compute v in in B hellip

(33)B

B

A

v

[M]A

(33)B

B

A

v

[M]A

1 1

1

1

1

x x

y y

x

y

x

y

x

y

M

M M M

M M

M

A BB B

B B A A B BA

A

B A AA

A

B A A

B

B

Note matrices used as both a geometric transformation [M] A) and a change of coordinates (MBlarrA amp MAlarrB)

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Two ways to visualize____________________ M M MB A A BA

[MRot(θ)]A

p

B

(33)Bv

A ()Bv

[MRot(θ)]A

p

[MRot(θ)]A

pp

B

(33)Bv (33)Bv

A A ()Bv ()Bv ()Bv

bull Measurement visualization ndash measure coordinates in A

ndash perform [M]A

ndash measure coordinates in B

bull Superimpose visualization

B

(33)Bv

A

B

(33)Bv (33)Bv

A A

B

(-11)v

A

A B

(-11)v (-11)v

A A

A A

B(

)

v

A

A B(

)

v(

)

v

A A

A A

(

)

v

B

A (

)

v(

)

v

B

A

B

A A

1) 2)

3) 4)

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Scale about arbitrary point

sxp

sy

B

A

Scale

Scale

1 1

1 0 0 0 1 0

0 1 0 0 0 1

0 0 1 0 0 1 0 0 1 1

0 (1 )

0 (1 )

0 0 1 1

x x x

y y y

x x x

y y y

x x

y y

p s p x

p s p y

s p s x

s p s y

M

M M M B B

B B A A A B B

B

B

B

B

B

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Differential Scale about arbitrary lines

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

In Progresshellip

bull Switch to

httpwwwcsunccedu~zwartellITCS204120-5120currentLecturesWartellweb20pageITCS204120-2D20Transformsppt

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Weird Cases Singular Matrices

1 0 0

0 0 0 - 2D space mapped to 1D space (line y=0)

0 0 1

0 0 0

0 0 0 - 2D space mapped to 0D space (point)

0 0 1

i

j

x x

y y

w w

x x

y y

w w

M

M

A

A

C

MiA maps all 2D space tothis line

MjA(C) ndash all 2D space maps to this pointA

MiA(C)

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions

041823copyZachary Wartell

Revisions11 - Work in progress completely replacing and revamping Dr Hodges older slides

  • 2D Transformations Revision 12 Copyright Zachary Wartell University of North Carolina All Rights Reserved
  • Matrices Change of Coordinates vs Geometric Transform
  • Recall Discrete Math 101 Relation Function One-to-one etc
  • Recall Converse Relation
  • Recall Function
  • Recall Function One-to-one
  • Recall Inverse of Function
  • 2D Transform
  • Affine Transformations
  • Preserve Lines
  • Parallelism
  • Distance Ratios
  • Translation
  • Rotate
  • Rotate about Origin
  • Scaling Uniform
  • Scale Differential
  • Inverse Transforms
  • Shear (along XY axis)
  • Reflections
  • Composing Transformations
  • Matrix Composition Non-Communitive
  • How do I rotate about arbitrary point p
  • If I know v in B (33)B and MRot(θ) in A then how do I compute v in in B
  • If I know v in B (33)B and MRot(θ) in A then how to I compute v in in B
  • Generally If I know v in B and M in A then compute v in in B hellip
  • Two ways to visualize____________________
  • Scale about arbitrary point
  • Differential Scale about arbitrary lines
  • In Progresshellip
  • Weird Cases Singular Matrices
  • Revisions