rotatePolygon function introduced