What is Shearing transformation in 2D computer graphics? Distinguish between…
What is Shearing transformation in 2D computer graphics? Distinguish between X-direction shear and Y-direction shear with their respective transformation matrices in homogeneous coordinates. Also, find the new coordinates of a square with vertices A(0, 0), B(2, 0), C(2, 2), and D(0, 2) when a shear factor of sh_x = 2 is applied in the X-direction.
Attempted by 15 students.
Show answer & explanation
Definition of Shearing
Shearing is a transformation that slants the shape of an object. It causes the object to appear as if it is composed of layers sliding over each other. Unlike scaling or rotation, shearing changes the angles of the object (distorting its shape), but the area of the object remains constant. A square typically becomes a parallelogram after a shearing transformation.
X-Shear vs. Y-Shear
X-Direction Shear: The x-coordinates of the points are changed while the y-coordinates remain constant. The amount of shift depends on the y value and the shear factor sh_x.
Matrix:

Y-Direction Shear: The y-coordinates are changed while the x-coordinates remain constant. The shift depends on the x value and the shear factor sh_y.
Matrix:

Numerical Calculation
Applying X-direction shear (sh_x = 2) to the square:
Vertex A(0, 0):
x' = x + (sh_x . y) = 0 + (2 . 0) = 0
y' = y = 0
New Point: A'(0, 0)
Vertex B(2, 0):
x' = x + (sh_x . y) = 2 + (2 . 0) = 2
y' = y = 0
New Point: B'(2, 0)
Vertex C(2, 2):
x' = x + (sh_x . y) = 2 + (2 . 2) = 6
y' = y = 2
New Point: C'(6, 2)
Vertex D(0, 2):
x' = x + (sh_x . y) = 0 + (2 . 2) = 4
y' = y = 2
New Point: D'(4, 2)
Final Result: The sheared square (now a parallelogram) has new vertices at A'(0, 0), B'(2, 0), C'(6, 2), and D'(4, 2).