kinshuk330 / 2D-transformation

for transformation(rotation,scaling,translation) of polygon and disc w.r.t origin using matrix multiplication

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2D-transformation

for transformation(rotation,scaling,translation) of polygon and disc w.r.t origin using matrix multiplication ##How to use:
Just run this file.

>Enter shape:

here you can enter either 'polygon' or 'disc'
If shape entered is polygon

>Enter no. of vertices:

you can enter as many vertices you want. Just be careful of the order in which you enter coordinates from next line.

>enter coordinates(x,y):

here you need to enter each coordinates of vertices one by one, like 1 1 (enter) 2 2 (enter) 3 1
If the shape entered above is disc.

>enter center coordinates and radius:

here you need to enter space separated center coordinates and radius.
after that it will ask for queries.
Valid Queries are- T,R,S (translation, rotation, scaling)
For Translation: 'T x y' ( where x and y are movement along x and y axis)
For Rotation: 'R Q' (where Q is the angle of rotation in degrees) For scaling: 'S Sx Sy' (where Sx and Sy are respective scaling in x and y direction)
for exit: 'q' or 'quit'

About

for transformation(rotation,scaling,translation) of polygon and disc w.r.t origin using matrix multiplication


Languages

Language:Python 100.0%