Table of Contents

Struct Arc3Point

Namespace
Xui.Core.Curves2D
Assembly
Core.dll

Represents a circular arc defined by three points: start, mid (on-curve), and end.

public readonly struct Arc3Point : ICurve
Implements
Inherited Members

Remarks

The arc is guaranteed to pass through all three control points P0, P1, and P2. The arc lies on the unique circle that intersects these points and is useful for geometric primitives, shader-based SDF rendering, and polygonal arc approximation.

Constructors

Arc3Point(Point, Point, Point)

Initializes a new Arc3Point defined by three on-curve points.

public Arc3Point(Point p0, Point p1, Point p2)

Parameters

p0 Point
p1 Point
p2 Point

Fields

P0

The starting point of the arc.

public readonly Point P0

Field Value

Point

P1

A point on the arc between P0 and P2.

public readonly Point P1

Field Value

Point

P2

The ending point of the arc.

public readonly Point P2

Field Value

Point

Properties

this[NFloat]

Provides indexer access as an alias for Lerp(NFloat).

public Point this[NFloat t] { get; }

Parameters

t NFloat

Property Value

Point

Methods

Length()

Computes an approximate arc length using 16 steps.

public NFloat Length()

Returns

NFloat

Length(NFloat)

Computes a refined approximation of arc length with a specified precision.

public NFloat Length(NFloat precision)

Parameters

precision NFloat

Returns

NFloat

Lerp(NFloat)

Evaluates the curve at the given normalized parameter t in [0, 1].

public Point Lerp(NFloat t)

Parameters

t NFloat

Returns

Point

SplitIntoYMonotonicCurves()

Splits the arc into one or two Y-monotonic Arc3Point segments.

public MonotonicArc3Point SplitIntoYMonotonicCurves()

Returns

MonotonicArc3Point

Remarks

This method finds the angle θ where the Y value of the arc reaches an extremum. If this point lies within the arc, the arc is split at that angle into two Y-monotonic sub-arcs. If no vertical extremum is found within the arc range, the arc is already monotonic.

Tangent(NFloat)

Computes the tangent vector at the specified t.

public Vector Tangent(NFloat t)

Parameters

t NFloat

Returns

Vector

ToCenterArc()

Converts this three-point arc into a center-based Arc if the arc is valid.

public Arc? ToCenterArc()

Returns

Arc?

A valid Arc if the input points define a circular segment; otherwise null. If the result is null, consider falling back to a straight Segment from P0 to P2.

ToEndpointArc()

Converts this arc to an endpoint-based ArcEndpoint format, if valid.

public ArcEndpoint? ToEndpointArc()

Returns

ArcEndpoint?

Operators

implicit operator Arc3Point((Point p0, Point p1, Point p2))

Implicitly converts a tuple of 3 points to an Arc3Point.

public static implicit operator Arc3Point((Point p0, Point p1, Point p2) value)

Parameters

value (Point p0, Point p1, Point p2)

Returns

Arc3Point