Struct ArcEndpoint
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
PointThe start point of the arc.
end
PointThe end point of the arc.
rx
NFloatThe horizontal radius.
ry
NFloatThe vertical radius.
rotation
NFloatThe clockwise rotation in radians applied to the ellipse.
largeArc
boolWhether the arc should be the larger of the two possible arcs.
winding
WindingThe sweep direction (clockwise or counter-clockwise).
Fields
End
The end point of the arc.
public readonly Point End
Field Value
LargeArc
If true, the arc is the longer (greater than 180°) of the two possible arcs between points.
public readonly bool LargeArc
Field Value
RadiusX
The horizontal radius of the arc.
public readonly NFloat RadiusX
Field Value
RadiusY
The vertical radius of the arc.
public readonly NFloat RadiusY
Field Value
Rotation
The clockwise rotation (in radians) applied to the arc's ellipse relative to the X axis.
public readonly NFloat Rotation
Field Value
Start
The start point of the arc.
public readonly Point Start
Field Value
Winding
The direction in which the arc is drawn (clockwise or counter-clockwise).
public readonly Winding Winding
Field Value
Properties
this[NFloat]
Gets the interpolated point on the arc at the specified parameter t
.
public Point this[NFloat t] { get; }
Parameters
t
NFloatA normalized value from 0 to 1 representing the progression along the arc.
Property Value
Methods
Evaluate(NFloat)
Evaluates the arc at a normalized parameter t
, returning the corresponding point.
public Point Evaluate(NFloat t)
Parameters
t
NFloatA 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
NFloatThe 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
NFloatA normalized value in the range [0, 1].
Returns
Tangent(NFloat)
Computes the tangent vector at parameter t
on the arc.
public Vector Tangent(NFloat t)
Parameters
t
NFloatA 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
intThe 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()