Theory:
A linear transformation is a mathematical function between two vector spaces that preserves the operations of addition and scalar multiplication.
Mathematically, a transformation T:V->W, (where V and W are vector spaces) is linear if T satisfies
T(u+v)=T(u)+T(v), for all u,v belongs to W
T(cu)=c(T(u)), for all u belongs to V and c belongs to R
Types of linear transformations :
1) Scaling (Dilation/Contraction):
Stretches or shrinks vectors by a constant factor along each axis.
Rotates the vector counter clockwise around the origin by a specified angle.
Distorts vectors by sliding them parallel to one axis, with the amount of distortion depending on the distance from the other axis.
Flips vectors across a line (e.g., the X-axis, Y-axis or a line through the origin)
Solution:
Python Code:
2]Apply the following transformations to a triangle with vertices at points: A(1, 1), B(3, 1), C(2, 3) Scaling by a factor of 2 (enlarges the triangle).Rotation by 90 degrees counter
clockwise (rotates the triangle). Translate by a vector of t = 5)
Solution:
Python Code:
Solution:
Python Code:
Theory Reflections:
Q1) How does each type of transformation (scaling, rotation, translation) change the position, size, or orientation of an object?
Ans. Transformations (Scaling, Rotation, Translation) change position, size, or orientation of object as mentioned below:
Translation moves an object from one place to another without changing its shape, size, or direction. Every point on the object shifts the same distance in a given direction. The object stays exactly the same, just in a new position.
Scaling changes the size of an object. It can make the object bigger or smaller, either evenly (uniform scaling) or unevenly in different directions (non-uniform scaling). The shape may stretch or shrink, but the orientation stays the same unless scaling is negative, which can flip it.
Rotation turns an object around a fixed point, usually the origin. The shape and size remain the same, but the object’s orientation changes based on the rotation angle. It simply spins in place without being resized.
Q 2) What is the importance of the order in which transformations are applied? How does changing the order affect the final outcome?
Ans. The order of transformations matters because the final result can change depending on how they are applied. Transformations like translation, rotation, and scaling do not always produce the same outcome when applied in a different sequence.
For instance, rotating an object and then translating it will give a different result than translating it first and then rotating. This happens because each transformation changes the object's position, orientation, or size, which then affects how the next transformation acts on it.
In fields like computer graphics or animation, getting the desired final position and appearance of an object depends on applying transformations in the correct order.
Q 3) What happens when multiple transformations are applied one after another? Can these transformations be combined into a single transformation matrix?
Ans. When several transformations are applied one after the other, each one affects the outcome of the next. The object goes through each transformation step by step, and the final result depends on both the types of transformations used and the order in which they are applied.
These multiple transformations can be merged into a single transformation matrix. By multiplying the individual matrices in the correct sequence, you create one matrix that represents the overall effect. This allows you to apply all the transformations at once, which simplifies calculations and improves efficiency—especially useful in computer graphics and animations.