Search This Blog

Showing posts with label shear transformation. Show all posts
Showing posts with label shear transformation. Show all posts

C Program for Shear Transformation - Shear Transformation in 2D Computer Graphics

Shear transformation or shearing is one of the 2d transformations in computer graphics. Here i present a c program for shear transformation of polygons. The shear transformation works as follows:

For shearing along X axis, shearfactor* (y coordinate) is added with x co-ordinates of all points. That is:
newx=oldx+shearfactor*oldy

Similarly, to shear along Y axis, we add shearfactor* (x coordinate) to y co-ordinates of all points.
newy=oldy+shearfactor*oldx