Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Scaling:-
X= X*Sx
Y= Y*Sy
If the scaling factors are less than one the object will smaller. If the scaling factors are greater than one,
the object factor will appear larger. If Sx=Sy=1, the object is unchanged.
3.Rotation:-
Rotation is a transformation that causes point P to be move relative to a central point without
changing the distance of P from that origin. This transformation is accomplished by applying the rotation
equation to each vertex of object. A rotation is specified by providing angle, b, indicating how many
degrees of rotation are desired .This angle may be either positive or negative. A positive angle indicates
a counter clockwise rotation about the origin.
X=Xcosb Ysinb
Y= Xcosb + Ysinb
These equation can be easily derived from the figure above, in which a rotation by B
Transformation P1(X,Y) into P2(X,Y).Because the rotation is about the origin, the distance from the
origin to P1 and P2 labeled r in the figure, are equal.
By simple trigonometry, we find that
sin(A+B)=sinA*cosB+cosA*sinB
cos(A+B)=cosA*cosB-sinA*sinB
We see that
And then
X=X*cosB-YsinB
Y=YcosB+XsinB
Thus,
X=XcosB YsinB
Y=XsinB + YcosB
4. Reflection
To reflect the 2D graphical object we use the standard matrix which consider the cases like x=0,
y=0, x=y and x=-y and then multiply the standard matrix with coordinate matrix and get the new
reflected points.
2.1Translation
The matrix for translation is :
2.2 Scale
To get the new transformed points we multiply the coordinate matrix with standard matrix.
2.3Rotation
The standard matrix for rotation is multiply with original coordinate to get new transformed points.