Class
RadArcSegment

Defines an arc segment for a path figure, allowing you to draw elliptical arcs within a bounding box. The arc is specified by its center point, size, start angle, and sweep angle, all relative to the containing geometry. This segment enables the creation of circular or elliptical arcs with customizable orientation and sweep direction, making it suitable for advanced vector graphics scenarios such as pie charts, gauges, or custom shapes.

Definition

Constructors

RadArcSegment()

Initializes a new instance of the arc segment.

Declaration

cs-api-definition
public RadArcSegment()

RadArcSegment(Point, Size, double, double)

Initializes a new instance of the arc segment.

Declaration

cs-api-definition
public RadArcSegment(Point center, Size size, double startAngle, double sweepAngle)

Parameters

center

Point

Specifies the center point of the arc segment. The point coordinates are relative to the containing geometry's bounding box, where (0, 0) is the bottom-left corner and (1, 1) is the top-right corner.

size

Size

Specifies the size of the arc segment. The width and height are values between 0 and 1, relative to the containing geometry's bounding box.

startAngle

double

Specifies the start angle of the arc segment in the cartesian coordinate system, where 0 points to the right and 90 points up. This value is measured in degrees, where 360 represents a full circle.

sweepAngle

double

Specifies the sweep angle of the arc segment with positive values indicating a counter-clockwise direction. This value is measured in degrees, where 360 represents a full circle.

Example

csharp
// Create an arc segment that draws a quarter circle in the top-right quadrant
var arcSegment = new RadArcSegment(
    center: new Point(0.5, 0.5),    // Center of the bounding box
    size: new Size(0.4, 0.4),       // 40% of the bounding box size
    startAngle: 0,                   // Start at 0 degrees (right side)
    sweepAngle: 90                   // Sweep 90 degrees counter-clockwise
);

Properties

Center

Gets or sets the center point of the arc segment. The point coordinates are relative to the containing geometry's bounding box, where (0, 0) is the bottom-left corner and (1, 1) is the top-right corner.

Declaration

cs-api-definition
public Point Center { get; set; }

Property Value

Point

Example

csharp
// Set the center of an arc segment to the middle of the bounding box
var arcSegment = new RadArcSegment();
arcSegment.Center = new Point(0.5, 0.5);  // Center point

// Create an arc in the bottom-left quadrant
arcSegment.Center = new Point(0.25, 0.25);

Size

Gets or sets the size of the arc segment. The width and height are values between 0 and 1, relative to the containing geometry's bounding box.

Declaration

cs-api-definition
[TypeConverter(typeof(SizeTypeConverter))]
public Size Size { get; set; }

Property Value

Size

Example

csharp
// Set the size of an arc segment to half the bounding box dimensions
var arcSegment = new RadArcSegment();
arcSegment.Size = new Size(0.5, 0.5);  // 50% width and height

// Create a small arc segment 
arcSegment.Size = new Size(0.2, 0.3);  // 20% width, 30% height

// Create a large arc that spans most of the bounding box
arcSegment.Size = new Size(0.8, 0.8);  // 80% width and height

StartAngle

Gets or sets the start angle of the arc segment in the cartesian coordinate system, where 0 points to the right and 90 points up. This value is measured in degrees, where 360 represents a full circle.

Declaration

cs-api-definition
public double StartAngle { get; set; }

Property Value

double

Example

csharp
// Create an arc segment starting from the right side (0 degrees)
var arcSegment = new RadArcSegment();
arcSegment.StartAngle = 0;    // Start at right side

// Create an arc starting from the top (90 degrees)
arcSegment.StartAngle = 90;   // Start at top

// Create an arc starting from the left side (180 degrees)
arcSegment.StartAngle = 180;  // Start at left side

// Create an arc starting from the bottom (270 degrees)
arcSegment.StartAngle = 270;  // Start at bottom

SweepAngle

Gets or sets the sweep angle of the arc segment with positive values indicating a counter-clockwise direction. This value is measured in degrees, where 360 represents a full circle.

Declaration

cs-api-definition
public double SweepAngle { get; set; }

Property Value

double

Example

csharp
// Create an arc segment with a 90-degree sweep (quarter circle)
var arcSegment = new RadArcSegment();
arcSegment.SweepAngle = 90;   // Quarter circle counter-clockwise

// Create a semicircle
arcSegment.SweepAngle = 180;  // Half circle counter-clockwise

// Create a clockwise arc (negative sweep angle)
arcSegment.SweepAngle = -90;  // Quarter circle clockwise