Table of Contents

Struct LinearSpline

Namespace
Xui.Core.Curves2D
Assembly
Core.dll

Represents a linear spline segment between two points.

public readonly struct LinearSpline : ICurve
Implements
Inherited Members

Remarks

A linear spline defines a straight-line interpolation between P0 and P1. It is the simplest form of spline, useful for polyline paths, control handles, and degenerate Bézier cases.

Constructors

LinearSpline(Point, Point)

Initializes a new LinearSpline segment between two points.

public LinearSpline(Point p0, Point p1)

Parameters

p0 Point

The starting point of the spline.

p1 Point

The ending point of the spline.

Fields

P0

The starting point of the line segment.

public readonly Point P0

Field Value

Point

P1

The ending point of the line segment.

public readonly Point P1

Field Value

Point

Properties

this[NFloat]

Evaluates the point on the spline at the specified parameter.

public Point this[NFloat t] { get; }

Parameters

t NFloat

Property Value

Point

Methods

Length()

Returns the length of the segment.

public NFloat Length()

Returns

NFloat

Length(NFloat)

Returns the length of the segment. Precision is ignored for linear splines.

public NFloat Length(NFloat precision)

Parameters

precision NFloat

Returns

NFloat

Lerp(NFloat)

Interpolates a point on the segment at the specified parameter.

public Point Lerp(NFloat t)

Parameters

t NFloat

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

Returns

Point

The interpolated point on the line.

Tangent(NFloat)

Gets the constant tangent vector of the line segment.

public Vector Tangent(NFloat t)

Parameters

t NFloat

A normalized parameter (unused, since the tangent is constant).

Returns

Vector

Operators

implicit operator LinearBezier(LinearSpline)

Converts this linear spline to a LinearBezier.

public static implicit operator LinearBezier(LinearSpline s)

Parameters

s LinearSpline

Returns

LinearBezier