Struct Arc3Point
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
Fields
P0
The starting point of the arc.
public readonly Point P0
Field Value
P1
public readonly Point P1
Field Value
P2
The ending point of the arc.
public readonly Point P2
Field Value
Properties
this[NFloat]
Provides indexer access as an alias for Lerp(NFloat).
public Point this[NFloat t] { get; }
Parameters
t
NFloat
Property Value
Methods
Length()
Computes an approximate arc length using 16 steps.
public NFloat Length()
Returns
Length(NFloat)
Computes a refined approximation of arc length with a specified precision.
public NFloat Length(NFloat precision)
Parameters
precision
NFloat
Returns
Lerp(NFloat)
Evaluates the curve at the given normalized parameter t in [0, 1].
public Point Lerp(NFloat t)
Parameters
t
NFloat
Returns
SplitIntoYMonotonicCurves()
Splits the arc into one or two Y-monotonic Arc3Point segments.
public MonotonicArc3Point SplitIntoYMonotonicCurves()
Returns
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
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 isnull
, 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
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)