Docsity

Práctica de Transformaciones 2D: Rotación, Escala y Traducción - Prof. Rodríguez Jordana, Ejercicios de Álgebra

Toggle sidebar
bg1
O
OO
O O
OO
O
O
OO
O O
OO
O
O
OO
O O
OO
O
(3)(3)
(
4
)
(
4
)
(1)(1)
O
OO
O O
OO
O
O
OO
O O
OO
O
(2)(2)
O
OO
O O
OO
O
EPSEB - EGT ALGEBRA PRACTICE 4 30 / 11 / 10
In this practice we will learn how to build 2-D transformations by means
axis rotation, translation and scaling, and how to see the effect over a polygon by
plotting both the polygon and its transformated
restart:with(LinearAlgebra):with(plots):
Entering the transformation elements:
angle of axis rotation g (in degrees), scaling factor lambda and translation vector t:
g:=40;
lambda:=2.5;
t:=Vector([5,4]);
g:= 40
λ:= 2.5
t:= 5
4
Rotation matrix R
ang:=evalf(g*Pi/180):
R:=Matrix([[cos(ang),sin(ang)],[-sin(ang),cos(ang)]]);
R:= 0.7660444431 0.6427876097
K
0.6427876097 0.7660444431
Building the similarity transformation T of a generic vector v
T:=v->lambda*R.(v-t);
T:= v/λ R.v
K
t
Let's now introduce n vectors
n:=4:
v[1]:=Vector([1,3]):
v[2]:=Vector([5,2]):
v[3]:=Vector([6,8]):
v[4]:=Vector([2,7]):
apply the transformation T
for i from 1 to n do
vt[i]:=T(v[i])
end do;
vt
1
:=
K
9.26741345525000072
4.51276498924999991
vt
2
:=
K
3.21393804850000020
K
3.83022221550000008
vt
3
:= 8.34298720475000088
6.05347540674999962
pf3
pf4

Vista previa parcial del texto

¡Descarga Práctica de Transformaciones 2D: Rotación, Escala y Traducción - Prof. Rodríguez Jordana y más Ejercicios en PDF de Álgebra solo en Docsity!

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

OOOOOOOO

EPSEB - EGT ALGEBRA PRACTICE 4 30 / 11 / 10

In this practice we will learn how to build 2-D transformations by means axis rotation, translation and scaling, and how to see the effect over a polygon by plotting both the polygon and its transformated

restart:with(LinearAlgebra):with(plots): Entering the transformation elements: angle of axis rotation g (in degrees), scaling factor lambda and translation vector t: g:=40; lambda:=2.5; t:=Vector([5,4]); g := 40 λ := 2.

t :=

Rotation matrix R ang:=evalf(g*Pi/180): R:=Matrix([[cos(ang),sin(ang)],[-sin(ang),cos(ang)]]);

R :=

K0.6427876097 0.

Building the similarity transformation T of a generic vector v T:=v->lambda*R.(v-t); T := v/ λ R. v Kt

Let's now introduce n vectors n:=4: v[1]:=Vector([1,3]): v[2]:=Vector([5,2]): v[3]:=Vector([6,8]): v[4]:=Vector([2,7]): apply the transformation T for i from 1 to n do vt[i]:=T(v[i]) end do;

vt 1 :=

K9.

vt 2 :=

K3.

K3.

vt 3 :=