2D Transformations

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

2D Transformalions

-aS
y-aS

Basic tamsfoations
kornations Ci) Trams latin (Chamgng on obiect's
poslbin)
Cientatim CRotabon) omd
C3) stze Csalng)
other tomsformatioms:
Reftechien omd
Sheanng operations
Tyanslaton :

;Pay')
ty
a=t t
PC,y
y'=y+by
ty’ tonslab'onal distomee along
alang L-a's

tx
T=
ty

Mabix torm: p= P+ T
QD TYmslatin

move a ine
ne segment, apply he tonstovmatinm
to each of the two Line end points amd edoaw the ine
between hew endpoints
To move

to
polygon, apply the tamsformatim eguatom
co-ordhates of each vestex and
vegenevale the
polygon using the mew set of vextee
Co-oodinates.
Example
P=

P -

[3-C1-(:]
C1,29|
2

Polygen A (2,5)
B(7,10)
Cio,2)
2
or A,

y 5+2-7
=xtta
Tor B,

y'= l0+ 2 J2
3 cach
to siy
new
the
formula
rotation
the
p'cy)pCzy)
formula
otaban
the polygon
deformation.
without bekween
the
nethe Sin)
vedsauing
SinG CoSe Cose-ysi
Sine
-y tc'
vedaoingapplyòng
2 obíecksaplying
iects amd -Cos«
=
and by co-odnates. oso
2
l0+ 224 nove
also by
Rotat'ons rotatedveles
points
- y'=y+tx tated
ttz points.io the X
Cas(B+o) a'
o end Vevtez Sind
=
Rotation:
2D lne of =
the oCos
end each
A t mew
Matietorm:
R= os )y=
30'Sin =
30
P=R-P Sin 9= =
Sin COSOSin =
2 V3
r(Sin
7
Sin9 Sin(o+o)
Coso
R= Sino c
oseStn-Sin&Cos Cos Cosx
tyose +
Sin8
ose -SinCos +
y
rCos99in Cos0
Coso
(2x)
(2x2)
Sin
d)
-|2

2-23 O-36
6)

pC413) angle ys

3
4
Sin 45

3 7
4 Sln4s
= 3Cos45t

ap scaling
used to alter the size of an obiect
Scaling is
Simple 20 saling e pefomed by mudtipgng
objeck pasitins Cay by scoling factos by ond sy

of am objedt
siz

52K!, Sy<l decreasing size of om objec


wntom scaling
Sn t sy n¡n- uni form sal'ng.

Example:

P=

NoTE!"

- If scaling factor k I, hen the


cbject stays unchanged.
’If scaling fator ai,then the dbject moves dose to
the on'gin on d >, then the
object
rnoves Jasthev from the ongtn.
Reflechiom
) Retlecin about L-au's

C+,t)

Cbcfoe veftectin)
y'y
Matiz fo:
O Cafter veflctin

P= P R

) Reftechim about y-aas:

C-it)
Ctt)

(hefore Cafter
nftectin) efeton)

(*y']:
9 Retechon atout Ongtn

Cbefore
reflechion) Cafter veflechim)

Vateom: Ca'

alp'= P. Ray
Cov)
p' P. Ro.

Refleca'm alout lne'

line

Rotate 4s in dock wise direhin


Cose Sne
- Sine Cos9

CosC-45°) Sin Cts) Cos 45°-Sin4s


-sin (-4s) Cos 4s) Sin45
Lsings os 46
(Sine CosC- e)-Cose
cmd Shee) -5ing
Rx

Step 3:

45

Rez'
|Cas 45 -Sin 45 7
Smys os 45

R.R
-45 45

Cxy)

arn d

Reflectin about 4z- ine


R Cos 45 Sints
tSinys Cos 45°

6) Reeckinn along y-ais:

Cos 45° 4 Sin ys


Rys'
-Sints Cos 45

p' Cz,y) Pay


-4s
Ref. R45

L
eflecti'on about yzmdtb lne
Translate the lone y mztb so that he line pases fhrough
he origin.
2: Perform otathim otth an
ang le (o)
step H: ferfon ohtim tth am amgle (-0).
seps: Perfovm evese thanslat'on.
Shear tamsfomatim
the shape ef object
2-shear y-shea ty-shear
X-shear..
Reseme y ales, chame values.

p': ey)

y-shear: Reserve a values


, hange y values.
yy+sh .x
shy
(3) 4shea

y'

Mabne Representation
’ Each of the three basi Dtransformati ons Can b
expressed in the genel m
shix form
p'
M,. P+ Ma
oith Pomd Pl
epresented as colu mn
vecors
M, is a
M is a two-element olmm mgin
lontalnig
tomslatimel tenms
’ for tamslation, M, is the matie
for otatim (ov) saling, M, ontns the tamslahimal
terms assoaate d with the pivot point or sang fad
polut
Moqeheous Coodinaes: (3)

Multipliabie and bamslational terms fo a two- di'mensiml

gomebic tranufomatim Can be Comblned nto a singlkmtin


It we expamd thie vepresontatione to 3X3 matites. Then, we Cay

use the thid colun of a tamsfovmabim mathi for the


Cam
bmslatin tems, and all he tbansformatim cquatins
expresscl as metin mtipltatious.
We
repvesent each Cavteian Coodinate pasitim Gay)
with the homogeneous Gosdinate iple :

where

h- alua a non-Zeo mumbe.

foy Translatin:

x': x t

P': P.T
(o)
10t

by

for Rotetin
x osO- y 5in
y' xsin6+ y Cose
(c'y') = (2c y )Gass Sino
- Sin o
Cos
(or)
rCose -Sin9
+ Sin& Cos 9

RCe). P
for Galaug

Sx

Co
ngeneous Coorelinates (15)

ta2, ty 20
T=

t 2 , ty =5

3 amd wnfs bottn


ty-2 nd

T
Imerse tmsfommatims
tramslatim, we obtan the (nvese mati
to
negabing the tomslation dstees.

-by
This
produes atamslation tn the opposite direchion,an4
the proda ct of a tamslatin mtrin amd its invese podas
the idety matie
Tnvese Rotatm
Reqlau omgle by #ncgaliw
Cose Sino
-Sin Coso

R RT

Negative values for otatin angles qene ate rotatims


in a clakuoise so
divectin, 5o the identity matia is
prooluced when amy notatim maki is
ts nverse. mutiplied by

Inese matie tor amy saliy tanformabion

4 Replae the scaling pavametes oith thetr


vecpocals.
The verse mati genexates
oypo ste saling
an

tamstomahisn ,so the multiplkatin f any ang


nahx th ts inve xe paducay the idorty
mari

You might also like