This project facilitates transformation on a variety of closed shapes like circles, squares, pentagons, or any closed polygon. We can plot these shapes and can view the changes that are made after the transformation. For transformation, I used 'numpy' module and for plotting figures, I used 'matplotlib'.
The transformation that can be done are:
- We scale shapes by a given factor in both x and y directions.
- We can translate shapes along the x and y direction by a given amount.
- And even we can rotate them by a given angle and along a given axis of rotation.
- We can also see the coordinate of vertices in case of polygons and radius and centre in case of circle after the transformation.
Some Example shapes and their plots are shown below. Note: After the transformation is done, the black dotted figure represents the old figure before tansformation, and the red figure is the new figure after transformation.
In the case of a circle, options that are available are :
- R deg (rx) (ry)
- S sr
- T dx (dy)
- P
In the case of a polygon, options that are available are :
- R deg (rx) (ry)
- S sx (sy)
- T dx (dy)
- P
Note : the properties that are inside the parenthesis are optional.
Then we rotate this circle by 145° anticlockwise and the axis of rotation is (1,1)
Then let say we want to scale it by a factor 1.5
Then let say we want to translate it by +2 along x axis and +3 along y axis
Let say we translate it by -6 in x axis and +2 in y axis
Then say we scale it by a factor 2 in x axis anf by 3 in y axis
Then at last we rotate is by 55 degree along its centre