Implement calculateHeadingToPoint and fix drawRegularPolygon