Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Scaling: Suppose We Set B C 0, But Let A and D Take On Any Positive Value

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Scaling

Suppose we set b=c=0, but let a and


d take on any positive value:
Gives a scaling matrix:
a 0
0 d

Provides differential scaling in x and y:


x ax
y dy

Scaling
a 0
0 d

x ax
y dy

Suppose we keep b=c=0, but let either a


or d go negative:
Examples:
1 0
0 1

1 0
0 1

Now lets leave a=d=1 and


experiment with b .
The matrix

b
1gives:
0 1

x x by
y y

Effect on unit square


Lets see how a general 2x2
transformation M affects the unit square:
a b
c d

a b
c d

q r s p q r s

0 1 1 0 0 a a b b
0 0 1 1 0 c c d d

Effect on unit square, cont.


Observe:
Origin invariant under M
M can be determined just by knowing how
the corners (1,0) and (0,1) are mapped
a and d give x- and y-scaling
b and c give x- and y-shearing

2D Scaling from the origin.


Point P defined as P ( x, y ),
Perform a scale (stretch) to Point P( x, y) by a factor s x along the x axis,
and s y along the y axis.
x s x . x,

y s y . y

Define the matrix


sx
S
0

P
P

0
s y

Now
P S P or

x s x
y 0

0
.
s y

x
y

2D Rotation about the


origin.
y

P(x,y)

P(x,y)

r
x

2D Rotation about the


origin.
y

x r. cos( ) r. cos . cos r. sin . sin


y r. sin( ) r. cos . sin r. sin . cos
P(x,y)

P(x,y)

x r. cos
y r. sin

r
x

2D Rotation about the


origin.
x r. cos( ) r. cos . cos r. sin . sin
y r. sin( ) r. cos . sin r. sin . cos
Substituting for r :

x r. cos
y r. sin
Gives us:

x x. cos y. sin
y x. sin y. cos

Rotation

Inverse Rotation

Limitations of the 2x2


matrix
A 2x2 matrix allows
Scaling
Rotation
Reflection
Shearing
Q: What important operation does that
leave out?

2D Translations.
Point P defined as P( x, y ),
translate to Point P( x, y) a distance d x parallel to x axis, d y parallel to y axis.
x x d x y y d y
Define the column vectors
x

P , P
y

Now
P P T

x
dx
,T

y
dy

P
P

2D Rotation about the


origin.
x x. cos y. sin
y x. sin y. cos
Rewriting in matrix form gives us :

x cos
y sin

sin
cos

x
y

cos
Define the matrix R
sin

sin
, P R P

cos

You might also like