Main modified

The input angle into the rotatePolygon must be in radians and not in degrees.
rotatePolygon function is now over