Overview of Shearing in 2D Graphics
Shearing in 2D graphics refers to the distortion of the shape of an object by shifting some of its points in a particular direction. So, this transformation basically changes the orientation of an object without any variation in area or volume and assumes a slanting or skew appearance.
Definition of Shearing
Displacing points with others fixed one way along the x-axis and another way along the y-axis is what shearing means. This will deform the shape along either the x-axis or the y-axis.
Shearing
deals with changing the shape and size of the 2D object along x-axis and y-axis. It is similar to sliding the layers in one direction to change the shape of the 2D object.It is an ideal technique to change the shape of an existing object in a two dimensional plane. In a two dimensional plane, the object size can be changed along X direction as well as Y direction.
Horizontal Shearing
In horizontal shearing, the x-coordinates of points change proportionally to their y-coordinates. The transformation can be written as:
( x' y′ )=( 1, 0, shx, 1)( x/y)
Where shx is the shearing factor for the x-axis.
Vertical Shearing
In vertical shearing, the y-coordinates of points change proportionally to their x-coordinates. The transformation can be expressed as:
( x' y′ )=( 1, shy, 0, 1)( x/y)
Where shy is the shearing factor for the y-axis.
Shearing Transformation Matrices
Horizontal Shear Matrix
The matrix for horizontal shearing is:
( 1, 0, shx, 1)
Vertical Shear Matrix
The matrix for vertical shearing is:
( 1, shy, 0, 1)
Properties of Shearing
- Linear Transformation: Shearing is a linear transformation that preserves lines but alters the angles between the lines.
- Non-rigid Transformation: The shape of objects changes by shearing; however, it does not preserve their original angles unlike scaling or rotating.
- Area Preservation: The area of a shape is preserved under a shearing transformation.
x-Shear :
In x shear, the y co-ordinates remain the same but the x co-ordinates changes. If P(x, y) is the point then the new points will be P’(x’, y’) given as -
x’=x+Sh_x*y; y’=y 
Matrix Form:
\begin{bmatrix}x'&y'\end{bmatrix}=\begin{bmatrix}x&y\end{bmatrix}.\begin{bmatrix}1&0\\Sh_x&1\end{bmatrix}
y-Shear :
In y shear, the x co-ordinates remain the same but the y co-ordinates changes. If P(x, y) is the point then the new points will be P’(x’, y’) given as -
x’=x; y’=y+Sh_y*x

Matrix Form:
\begin{bmatrix}x'&y'\end{bmatrix}=\begin{bmatrix}x&y\end{bmatrix}.\begin{bmatrix}1&Sh_y\\0&1\end{bmatrix}
x-y Shear :
In x-y shear, both the x and y co-ordinates changes. If P(x, y) is the point then the new points will be P’(x’, y’) given as -
x’= x+Sh_x*y; y’=y+Sh_y*x

Matrix Form:
\begin{bmatrix}x'&y'\end{bmatrix}=\begin{bmatrix}x&y\end{bmatrix}.\begin{bmatrix}Sh_x & 1\\1 &Sh_y\end{bmatrix}Example :
Given a triangle with points (1, 1), (0, 0) and (1, 0). Find out the new coordinates of the object along x-axis, y-axis, xy-axis. (Applying shear parameter 4 on X-axis and 1 on Y-axis.).
Explanation -
Given,
Old corner coordinates of the triangle = A (1, 1), B(0, 0), C(1, 0)
Shearing parameter along X-axis (Shx) = 4
Shearing parameter along Y-axis (Shy) = 1
Along x-axis:
A'=(1+4*1, 1)=(5, 1)
B'=(0+4*0, 0)=(0, 0)
C'=(1+4*0, 0)=(1, 0)
Along y-axis:
A''=(1, 1+1*1)=(1, 2)
B''=(0, 0+1*0)=(0, 0)
C''=(1, 0+1*1)=(1, 1)
Along xy-axis:
A'''=(1+4*1, 1+1*1)=(5, 2)
B'''=(0+4*0, 0+1*0)=(0, 0)
C'''=(1+4*0, 0+1*1)=(1, 1)
2D Shearing in Computer Graphics
Similar Reads
Gouraud Shading in Computer Graphics Gouraud shading is a method used in computer graphics to simulate the differing effect of light and color across the surface of an object. Intensity- interpolation is used to develop Gouraud shading. By intensity interpolation, the intensity of each and every pixel is calculated. Gouraud shading sha
3 min read
Segments in Computer Graphics Introduction : Introduction segments are a fundamental concept in computer graphics, used to represent the basic building blocks of a graphical scene. They are commonly used in 2D graphics to represent lines or curves that connect two or more points. An introduction segment is defined by two endpoin
8 min read
Composite Transformation in 2-D graphics Prerequisite - Basic types of 2-D Transformation :Â Â TranslationScalingRotationReflectionShearing of a 2-D objectComposite Transformation :Â As the name suggests itself Composition, here we combine two or more transformations into one single transformation that is equivalent to the transformations th
3 min read
Projections in Computer Graphics Representing an n-dimensional object into an n-1 dimension is known as projection. It is process of converting a 3D object into 2D object, we represent a 3D object on a 2D plane {(x,y,z)->(x,y)}. It is also defined as mapping or transforming of the object in projection plane or view plane. When g
5 min read
Computer Graphics - 3D Shearing Transformation Shearing transformation is the same as we see in 2D space, but here we have to deal with the x, y, and z axes whereas in 2D we deal with the only x and y axes. Shearing is the process of slanting an object in 3D space either in x, y, or in the z-direction. Shearing changes(or deformed) the shape of
4 min read
Multiple Windowing in Computer Graphics Pre-requisites: Line Clipping Clipping is the process of removing undesired parts of an image and displaying only a certain portion of the image. Clipping is used to remove lines or objects that are not inside the viewing pane. The portion that is being removed or clipped is called the clipped part.
2 min read