PeachDrawing.Core

PeachDrawing.Core.Geometry.PathShapes

PathShapes.AddRegularPolygon(this GraphicsPath, double, double, double, int, double) Method

Adds a regular polygon whose first vertex points up (toward negative y) before rotation.

public static void AddRegularPolygon(this PeachDrawing.Core.GraphicsPath path, double centerX, double centerY, double radius, int sides, double rotationRadians=0.0);

Parameters

path GraphicsPath

the path to add to

centerX System.Double

the center’s x-coordinate

centerY System.Double

the center’s y-coordinate

radius System.Double

the distance from the center to each vertex

sides System.Int32

the number of sides; at least 3

rotationRadians System.Double

clockwise rotation about the center

Exceptions

System.ArgumentOutOfRangeException
sides is less than 3