


Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!



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 :=
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 :=
vt 2 :=
vt 3 :=