Table of Contents

Struct ArcEndpoint

Namespace
Xui.Core.Curves2D
Assembly
Core.dll

Represents a circular or elliptical arc defined by radii, rotation, and endpoint parameters.

public readonly struct ArcEndpoint : ICurve
Implements
Inherited Members

Remarks

This arc representation uses start and end points along with size and sweep flags. It is commonly used in vector graphics where the arc shape is inferred from geometry and direction flags.

Constructors

ArcEndpoint(Point, Point, NFloat, NFloat, NFloat, bool, Winding)

Initializes a new ArcEndpoint with the given geometry and flags.

public ArcEndpoint(Point start, Point end, NFloat rx, NFloat ry, NFloat rotation, bool largeArc, Winding winding)

Parameters

start Point

The start point of the arc.

end Point

The end point of the arc.

rx NFloat

The horizontal radius.

ry NFloat

The vertical radius.

rotation NFloat

The clockwise rotation in radians applied to the ellipse.

largeArc bool

Whether the arc should be the larger of the two possible arcs.

winding Winding

The sweep direction (clockwise or counter-clockwise).

Fields

End

The end point of the arc.

public readonly Point End

Field Value

Point

LargeArc

If true, the arc is the longer (greater than 180°) of the two possible arcs between points.

public readonly bool LargeArc

Field Value

bool

RadiusX

The horizontal radius of the arc.

public readonly NFloat RadiusX

Field Value

NFloat

RadiusY

The vertical radius of the arc.

public readonly NFloat RadiusY

Field Value

NFloat

Rotation

The clockwise rotation (in radians) applied to the arc's ellipse relative to the X axis.

public readonly NFloat Rotation

Field Value

NFloat

Start

The start point of the arc.

public readonly Point Start

Field Value

Point

Winding

The direction in which the arc is drawn (clockwise or counter-clockwise).

public readonly Winding Winding

Field Value

Winding

Properties

this[NFloat]

Gets the interpolated point on the arc at the specified parameter t.

public Point this[NFloat t] { get; }

Parameters

t NFloat

A normalized value from 0 to 1 representing the progression along the arc.

Property Value

Point

Methods

Evaluate(NFloat)

Evaluates the arc at a normalized parameter t, returning the corresponding point.

public Point Evaluate(NFloat t)

Parameters

t NFloat

A normalized value in the range [0, 1].

Returns

Point

The corresponding point on the arc.

Length()

Approximates the arc length using uniform sampling with 16 segments.

public NFloat Length()

Returns

NFloat

The approximate total arc length.

Length(NFloat)

Approximates the arc length using recursive adaptive subdivision.

public NFloat Length(NFloat flatness)

Parameters

flatness NFloat

The maximum allowed error per segment for arc approximation.

Returns

NFloat

The computed arc length within the specified flatness tolerance.

Lerp(NFloat)

Computes the interpolated point on the arc at a given parameter t.

public Point Lerp(NFloat t)

Parameters

t NFloat

A normalized value in the range [0, 1].

Returns

Point

Tangent(NFloat)

Computes the tangent vector at parameter t on the arc.

public Vector Tangent(NFloat t)

Parameters

t NFloat

A normalized value in the range [0, 1].

Returns

Vector

The normalized tangent vector at the evaluated point on the arc.

ToArc3Segments(Span<Arc3Point>, out int)

Splits this arc into a series of Arc3Point segments, each spanning ≤ 90° and aligned so that one edge is axis-aligned.

public void ToArc3Segments(Span<Arc3Point> buffer, out int count)

Parameters

buffer Span<Arc3Point>

A span to receive the output segments. Must have space for up to 4 entries.

count int

The number of segments written to buffer.

Remarks

This method converts the arc into a center-based Arc representation, then delegates to its ToArc3Segments(Span<Arc3Point>, out int) method. Each resulting Arc3Point segment spans ≤ 90° and is safe for monotonic tessellation.

ToCenterArc()

Converts this endpoint-parameterized arc to a center-based Arc.

public Arc ToCenterArc()

Returns

Arc

A new Arc representing the same shape.