Two dimentional transform

Post on 22-May-2015

805 Views

Category:

Business

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

2D transformation

Transcript

TransformationAn operation that changes one

configuration into another

Types of TransformationGeometric transformation

Object itself is transformed relative to a stationary co-ordinate

Co-ordinate transformation Co-ordinate system is transformed relative to an

object Object is held stationary

2D Geometric TransformationsA two dimensional transformation is any

operation on a point in space (x y) that maps that points coordinates into a new set of coordinates (x1 y1)

Instead of applying a transformation to every point in every line that makes up an object the transformation is applied only to the vertices of the object and then new lines are drawn between the resulting endpoints

2D Geometric Transformations

Translate

Rotate Scale

Shear

2D TranslationOne of rigid-body transformation which move objects

withoutdeformation

Translate an object by Adding offsets to coordinates to generatenew coordinates positions

Set tx ty be the translation distance we have

Prsquo=P+TTranslation moves the object without

deformation

P

Prsquo

Txtxx ytyy

y

xP

y

x

t

tT

y

xP

Basic 2D TranslationTo move a line segment apply the

transformation equation to each of the two line endpoints and redraw the line between new endpoints

To move a polygon apply the transformation equation to coordinates of each vertex and regenerate the polygon using the new set of vertex coordinates

Example Translate a polygon with coordinates A(25) B(710) and c(102) by 3 units in x direction and 4 units in y direction

2D RotationObject is rotated ϴdeg about the originϴ gt 0 ndash rotation is counter clock wiseϴ lt 0 ndash rotation is clock wise

6

y

x 0 1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D Geometric TransformationsA two dimensional transformation is any

operation on a point in space (x y) that maps that points coordinates into a new set of coordinates (x1 y1)

Instead of applying a transformation to every point in every line that makes up an object the transformation is applied only to the vertices of the object and then new lines are drawn between the resulting endpoints

2D Geometric Transformations

Translate

Rotate Scale

Shear

2D TranslationOne of rigid-body transformation which move objects

withoutdeformation

Translate an object by Adding offsets to coordinates to generatenew coordinates positions

Set tx ty be the translation distance we have

Prsquo=P+TTranslation moves the object without

deformation

P

Prsquo

Txtxx ytyy

y

xP

y

x

t

tT

y

xP

Basic 2D TranslationTo move a line segment apply the

transformation equation to each of the two line endpoints and redraw the line between new endpoints

To move a polygon apply the transformation equation to coordinates of each vertex and regenerate the polygon using the new set of vertex coordinates

Example Translate a polygon with coordinates A(25) B(710) and c(102) by 3 units in x direction and 4 units in y direction

2D RotationObject is rotated ϴdeg about the originϴ gt 0 ndash rotation is counter clock wiseϴ lt 0 ndash rotation is clock wise

6

y

x 0 1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D Geometric Transformations

Translate

Rotate Scale

Shear

2D TranslationOne of rigid-body transformation which move objects

withoutdeformation

Translate an object by Adding offsets to coordinates to generatenew coordinates positions

Set tx ty be the translation distance we have

Prsquo=P+TTranslation moves the object without

deformation

P

Prsquo

Txtxx ytyy

y

xP

y

x

t

tT

y

xP

Basic 2D TranslationTo move a line segment apply the

transformation equation to each of the two line endpoints and redraw the line between new endpoints

To move a polygon apply the transformation equation to coordinates of each vertex and regenerate the polygon using the new set of vertex coordinates

Example Translate a polygon with coordinates A(25) B(710) and c(102) by 3 units in x direction and 4 units in y direction

2D RotationObject is rotated ϴdeg about the originϴ gt 0 ndash rotation is counter clock wiseϴ lt 0 ndash rotation is clock wise

6

y

x 0 1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D TranslationOne of rigid-body transformation which move objects

withoutdeformation

Translate an object by Adding offsets to coordinates to generatenew coordinates positions

Set tx ty be the translation distance we have

Prsquo=P+TTranslation moves the object without

deformation

P

Prsquo

Txtxx ytyy

y

xP

y

x

t

tT

y

xP

Basic 2D TranslationTo move a line segment apply the

transformation equation to each of the two line endpoints and redraw the line between new endpoints

To move a polygon apply the transformation equation to coordinates of each vertex and regenerate the polygon using the new set of vertex coordinates

Example Translate a polygon with coordinates A(25) B(710) and c(102) by 3 units in x direction and 4 units in y direction

2D RotationObject is rotated ϴdeg about the originϴ gt 0 ndash rotation is counter clock wiseϴ lt 0 ndash rotation is clock wise

6

y

x 0 1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Basic 2D TranslationTo move a line segment apply the

transformation equation to each of the two line endpoints and redraw the line between new endpoints

To move a polygon apply the transformation equation to coordinates of each vertex and regenerate the polygon using the new set of vertex coordinates

Example Translate a polygon with coordinates A(25) B(710) and c(102) by 3 units in x direction and 4 units in y direction

2D RotationObject is rotated ϴdeg about the originϴ gt 0 ndash rotation is counter clock wiseϴ lt 0 ndash rotation is clock wise

6

y

x 0 1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Example Translate a polygon with coordinates A(25) B(710) and c(102) by 3 units in x direction and 4 units in y direction

2D RotationObject is rotated ϴdeg about the originϴ gt 0 ndash rotation is counter clock wiseϴ lt 0 ndash rotation is clock wise

6

y

x 0 1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D RotationObject is rotated ϴdeg about the originϴ gt 0 ndash rotation is counter clock wiseϴ lt 0 ndash rotation is clock wise

6

y

x 0 1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2-D Rotationx = r cos ()y = r sin ()xrsquo = r cos ( + )yrsquo = r sin ( + )

Trig Identityhellipxrsquo = r cos() cos() ndash r sin() sin()yrsquo = r sin() sin() + r cos() cos()

Substitutehellipxrsquo = x cos() - y sin()yrsquo = x sin() + y cos()

(x y)

(xrsquo yrsquo)

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Basic 2D Geometric Transformations2D Rotation matrix

Prsquo=RP

cossin

sincosR

ΦΦ

(xy)rr θ

(xrsquoyrsquo)

y

x

y

x

cossin

sincos

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Basic 2D Geometric Transformations2D Rotation

Rotation for a point about any specified position (xr yr)

xrsquo=xr+(x - xr) cos θ ndash (y - yr) sin θ

yrsquo=yr+(x - xr) sin θ + (y - yr) cos θ

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Rotations also move objects without deformation

A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points

A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

ExampleA point (43) is rotated counterclockwise by an angle 45deg find the rotation matrix and resultant point

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Basic 2D Geometric Transformations2D Scaling

Scaling is the process of expanding or compressing the dimension of an object

Simple 2D scaling is performed by multiplying object positions (x y) by scaling factors sx and sy

xrsquo = x sx

yrsquo = y sy

or Prsquo = SP

y

x

s

s

y

x

y

x

0

0

P(xy)

Prsquo(xrsquoyrsquo)

xsx x

sy y

y

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D ScalingAny positive value can

be used as scaling factor Sf lt 1 reduce the size of

the objectSf gt 1 enlarge the object

Sf = 1 then the object stays unchanged

If sx = sy we call it uniform scaling

If scaling factor lt1 then the object moves closer to the origin and If scaling factor gt1 then the object moves farther from the origin

y

x 0

1

1

2

2

3 4 5 6 7 8 9 10

3

4

5

6

1

2

1

3

3

6

3

9

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Basic 2D Geometric Transformations2D Scaling

We can control the location of the scaled object by choosing a position called the fixed point (xf yf)

xrsquo ndash xf = (x ndash xf) sx yrsquo ndash yf = (y ndash yf) sy

xrsquo=x sx + xf (1 ndash sx)

yrsquo=y sy + yf (1 ndash sy)

Polygons are scaled by applying the above formula to each vertex then regenerating the polygon using the transformed vertices

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Example

Scale the polygon with co-ordinates A(25) B(710) and c(102) by 2 units in x direction and 2 units in y direction

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Homogeneous Coordinates

Expand each 2D coordinate (x y) to three element representation (xh yh h) called homogenous coordinates

h is the homogenous parameter such that

x = xhh y = yhh

A convenient choice is to choose h = 1

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Homogeneous Coordinates for translation

2D Translation Matrix

or Prsquo = T(txty)P

1100

10

01

1

y

x

t

t

y

x

y

x

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Homogeneous Coordinates for rotation

2D Rotation Matrix

or Prsquo = R(θ)P

1100

0cossin

0sincos

1

y

x

y

x

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Homogeneous Coordinates for scaling2D Scaling Matrix

or Prsquo = S(sxsy)P

1100

00

00

1

y

x

s

s

y

x

y

x

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Inverse Transformations2D Inverse Translation Matrix

100

10

011

y

x

t

t

T

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Inverse Transformations2D Inverse Rotation Matrix

100

0cossin

0sincos1R

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Inverse Transformations2D Inverse Scaling Matrix

100

01

0

001

1

y

x

s

s

S

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D Composite TransformationsWe can setup a sequence of

transformations as a composite transformation matrix by calculating the product of the individual transformations

Prsquo=M2M1P

Prsquo=MP

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D Composite TransformationsComposite 2D Translations

100

10

01

100

10

01

100

10

01

21

21

1

1

2

2

yy

xx

y

x

y

x

tt

tt

t

t

t

t

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D Composite TransformationsComposite 2D Rotations

100

0)cos()sin(

0)sin()cos(

100

0cossin

0sincos

100

0cossin

0sincos

2121

2121

11

11

22

22

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

2D Composite TransformationsComposite 2D Scaling

100

00

00

100

00

00

100

00

00

21

21

1

1

2

2

yy

xx

y

x

y

x

ss

ss

s

s

s

s

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

100

sin)cos1(cossin

sin)cos1(sincos

100

10

01

100

0cossin

0sincos

100

10

01

rr

rr

r

r

r

r

xy

yx

y

x

y

x

rrrrrr yxRyxTRyxT

Translate Rotate Translate

(xry

r)(xry

r)(xry

r)(xry

r)

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

100

)1(0

)1(0

100

10

01

100

00

00

100

10

01

yfy

xfx

f

fx

f

f

sys

sxs

y

x

s

s

y

x

y

Translate Scale Translate

(xryr

)(xry

r)(xry

r)(xry

r)

yxffffyxff ssyxSyxTssSyxT

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Another Example

Scale

Translate

Rotate

Translate

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

ExampleI sat in the car and find the side mirror is 04m

onmy right and 03m in my front

bull I started my car and drove 5m forward turned 30

degrees to right moved 5m forward again andturned 45 degrees to the right and stopped

bull What is the position of the side mirror nowrelative to where I was sitting in the beginning

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Other Two Dimensional Transformations

ReflectionTransformation that produces a mirror image of an object

Image is generated relative to an axis of reflection by rotating the object 180deg about the reflection axis

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Reflection about the line y=0 (the x axis)

100

010

001

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Reflection about the line x=0 (the y axis)

100

010

001

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Reflection about the origin

100

010

001

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Reflection when x = y

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Example

Consider the triangle ABC with co-ordinates x(41) y(52) z(43) Reflect the triangle about the x axis and then about the line y = -x

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

ShearTransformation that distorts the shape

of an object is called shear transformation

Two shearing transformation usedShift X co-ordinates valuesShift Y co-ordinates values

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

X shear

y

x

(01) (11)

(10)(00)

y

x

(21) (31)

(10)(00)shx=2

100

010

01 xsh

yy

yshxx x

Preserve Y coordinates but change the X coordinates values

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Y shearPreserve X coordinates but change the Y coordinates values

xrsquo = x yrsquo = y + Shy x

y

x

(01) (11)

(10)(00)

y

x

(01)

(12)

(11)(00)

100

01

001

ysh

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Example

Perform x shear and y shear along on a triangle A(21) B(43) C(23) sh = 2

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Shear relative to other axisX shear with reference to Y axis

x

y

1

1

yref = -1

x

shx = frac12 yref = -1

1

1 2 3

yref = -1

( )x refx x sh y y

y y

1

0 1 0

1 0 0 1 1

x x refx sh sh y x

y y

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Shear relative to other axisY shear with reference to X axis

( )y ref

x x

y y sh x x

1 0 0

1

1 0 0 1 1x y ref

x x

y sh sh x y

x

y

1

1xref = -1

y

x

1

1

2

xref = -1

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Example

Apply shearing transformation to square with A(00) B(10) C(11) D(01)

Shear parameter value is 05 relative to line Yref = - 1 and Xref = - 1

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

321321321 M)MM()MM(MMMM

Associative properties

Transformation is not commutative (CopyCD)Order of transformation may affect

transformation position

Matrix Concatenation Properties

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Transformations between 2D Transformations between 2D Coordinate SystemsCoordinate Systems

To translate object descriptions from xy coordinates to xrsquoyrsquo coordinates we set up a transformation that superimposes the xrsquoyrsquo axes onto the xy axes This is done in two steps

1Translate so that the origin (x0 y0) of the xrsquoyrsquo system is moved to the origin (0 0) of the xy system

2Rotate the xrsquo axis onto the x axis

x

y

x0

xrsquo yrsquo

y0

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

Translation(xrsquoyrsquo)=Tv(xy)xrsquo= x ndash txyrsquo=y-ty

Rotation about origin(xrsquoyrsquo)=Rϴ(xy)xrsquo= xcosϴ + ysinϴ

yrsquo= -xsinϴ + ycosϴ

Scaling with origin(xrsquo yrsquo)=Ssx sy(xy)xrsquo= (1sx)xyrsquo= (1sy)y

Reflection about X axis(xrsquoyrsquo)= Mx(xy)xrsquo= xyrsquo= -y

Reflection about Y axis(xrsquoyrsquo)= My(xy)xrsquo= -xyrsquo= y

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

ExampleFind the xrsquoyrsquo-coordinates of the xy points (10

20) and (35 20) as shown in the figure below

x

y

30

xrsquo

yrsquo

1030ordm

(10 20)

(35 20)

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

ExampleFind the xrsquoyrsquo-coordinates of the rectangle

shown in the figure below

x

y

10

xrsquo

yrsquo 10

60ordm

20

top related