private Point[] CalculateVertices( int sides, int radius, int startingAngle, Point center )
{
if ( sides < 3 )
throw new ArgumentException( "Polygon must have 3 sides or more." );
List<Point> points = new List<Point>();
float step = 360.0f / sides;
float angle = startingAngle;
for ( double i = startingAngle; i < startingAngle + 360.0; i += step ) {
points.Add( DegreesToXY( angle, radius, center ) );
angle += step;
}
return points.ToArray();
}