Presentation is loading. Please wait.

Presentation is loading. Please wait.

6/22/2015©Zachary Wartell 2D Transformations Revision 1.2 Copyright Zachary Wartell, University of North Carolina All Rights Reserved Textbook: Chapter.

Similar presentations


Presentation on theme: "6/22/2015©Zachary Wartell 2D Transformations Revision 1.2 Copyright Zachary Wartell, University of North Carolina All Rights Reserved Textbook: Chapter."— Presentation transcript:

1 6/22/2015©Zachary Wartell 2D Transformations Revision 1.2 Copyright Zachary Wartell, University of North Carolina All Rights Reserved Textbook: Chapter 5

2 6/22/2015©Zachary Wartell Matrices: Change of Coordinates vs Geometric Transform A [Mi]A[Mi]A ●Matrices can represent a change of coordinates denoted: M A ← B ● Matrices are also useful for representing transformations of geometry denoted: [M i ] A, [ M j ] A, [ M k ] A [Mj]A[Mj]A

3 6/22/2015©Zachary Wartell Recall: Discrete Math 101: Relation, Function, One-to-one, etc. Relation (Binary) Domain D Range R relation L (on|in) set D (onto|into) set R, L = {(d,r) | d  D and r  R} onto in on into

4 6/22/2015©Zachary 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' (r,d)  CONVERSE( L ) iff (d,r)  L

5 6/22/2015©Zachary Wartell Recall: Function function – 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!

6 6/22/2015©Zachary Wartell Recall: Function One-to-one one-to-one function – 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

7 6/22/2015©Zachary Wartell Recall: Inverse of Function a 1-to-1 function F has a 'inverse' function F -1. –Take F. build CONVERSE(F). Since F is 1-to-1, CONVERSE(F) is also function. CONVERSE(F) is a function syn. the ‘inverse exists’, F -1 exists, F is ‘invertible’, F is 'non-singular' Domain D Range R A one-to-one Function! D' R'

8 6/22/2015©Zachary Wartell 2D Transform 2D function that maps points ( x, y ) to points ( x', y' ) Example: F: ( x, y )  ( x, y+x 2 )

9 6/22/2015©Zachary Wartell Affine Transformations translate (T) – preserve area, length, angles, orientation rotate (R) – preserve area, length, angles scale (S) – preserve perpendicularity of axis rigid-body/congruency – (T · R) preserve area, length, angles uniform scale/”similarity” – preserve angles, orientation All affine transformations: ●preserve lines ●preserve parallelism ● preserve distance ratio (→equal spacing) ●'map points to points & vectors to vectors' Start:

10 6/22/2015©Zachary Wartell ' Preserve Lines l l'l' M transforming entire grid l: p = p 0 + t ( p 1 - p 0 ) → l': M(p) =M( p 0 ) + t (M( p 1 )-M( p 0 )) p0p0 p1p1 p p0p0 p p1p1 ' '

11 6/22/2015©Zachary Wartell Parallelism lala lblb la'la' lb'lb' M transforming entire grid l a || l b → M(l a ) || M(l b ) = l' a || l' b

12 6/22/2015©Zachary Wartell Distance Ratios l l'l' M transforming entire grid ab/bc = a'b'/b'c' a b c a'a' b'b' c'

13 6/22/2015©Zachary Wartell Translation add offset vector, t, to every point t ( x,y )  ( x+t x,y+t y ) matrix form:

14 6/22/2015©Zachary Wartell Rotate specify pivot point and angle how to rotate ( x,y ) about P through θ ? –algebra: assume P is origin P θ Observe: sin (Φ + θ) = y'/rcos (Φ + θ) = x'/r sin Φ = y/rcos Φ = x/r x-axis (x,y) (x’,y’) Φ θ r (0,0) y-axis Use double angle formulas: cos (Φ + θ) = cos Φ cosθ - sin Φ sinθ sin (Φ + θ) = sin Φ cosθ + cos Φ sinθ Substitute: x'/r = (x/r)cos θ - (y/r)sin θ Therefore: x' = x cos θ - y sin θ Similarly: y' = x sin θ + ycos θ

15 6/22/2015©Zachary Wartell Rotate about Origin matrix form:

16 6/22/2015©Zachary Wartell uniform scale specified by scale factor s and fixed point p algebra: assume scale about origin x'=s x, y' =s y i.e. Scaling: Uniform 1 s p

17 6/22/2015©Zachary Wartell specify two scale factors sx and sy, and two perpendicular fixed lines algebra: assume scale along x and y axis Scale: Differential sx p sy B

18 6/22/2015©Zachary Wartell Inverse Transforms translate rotate scale

19 6/22/2015©Zachary Wartell Shear (along X/Y axis) Y Shear (in terms of X) X Shear (in terms of Y)

20 6/22/2015©Zachary Wartell Reflections X Axis ReflectionY Axis Reflection Origin ReflectionReflection on y=x

21 6/22/2015©Zachary Wartell Composing Transformations Examples:

22 6/22/2015©Zachary Wartell Matrix Composition: Non-Communitive! Matrix multiplication non-communitive Example 1 2 2 1

23 6/22/2015©Zachary Wartell How do I rotate about arbitrary point p? B [M Rot(θ) ] B (3,3) B v A M Rot (θ,p) p (?,?) B v' (3,3) B v [M Rot(θ) ] A =[M Rot(θ,p) ] B p

24 6/22/2015©Zachary Wartell If I know v in B, (3,3) B, and M Rot(θ) in A, then how do I compute v' in in B ? Note, matrices used as both:  a geometric transformation [M ? ] A ) and  a change of coordinates (M B ← A & M A ← B )

25 6/22/2015©Zachary Wartell If I know v in B, (3,3) B, and M Rot(θ) in A, then how to I compute v' in in B ?

26 6/22/2015©Zachary Wartell Generally: If I know v in B, and M ? in A, then compute v' in in B … Note, matrices used as both:  a geometric transformation [M ? ] A ) and  a change of coordinates (M B ← A & M A ← B )

27 6/22/2015©Zachary Wartell Two ways to visualize____________________ Measurement visualization: –measure coordinates in A –perform [M ? ] A –measure coordinates in B Superimpose visualization: 1) 2) 3) 4)

28 6/22/2015©Zachary Wartell Scale about arbitrary point sx p sy BA

29 6/22/2015©Zachary Wartell Differential Scale about arbitrary lines

30 6/22/2015©Zachary Wartell In Progress… Switch to http://www.cs.uncc.edu/~zwartell/ITCS%204120- 5120/current/Lectures/Wartell/web%20page/ITCS%2041 20-2D%20Transforms.ppthttp://www.cs.uncc.edu/~zwartell/ITCS%204120- 5120/current/Lectures/Wartell/web%20page/ITCS%2041 20-2D%20Transforms.ppt

31 6/22/2015©Zachary Wartell Weird Cases: Singular Matrices C M i A maps all 2D space to this line M j A (C) – all 2D space maps to this point A M i A (C)

32 6/22/2015©Zachary Wartell Revisions 1.1 - Work in progress, completely replacing and revamping Dr. Hodges older slides


Download ppt "6/22/2015©Zachary Wartell 2D Transformations Revision 1.2 Copyright Zachary Wartell, University of North Carolina All Rights Reserved Textbook: Chapter."

Similar presentations


Ads by Google