Interpolation.CircularLinearCurve Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0

Overload List

CircularLinearCurve(Double[], Double[], Boolean) Creates a piecewise linear interpolating curve for circular/angular data.
CircularLinearCurve(ReadOnlySpan<Double>, ReadOnlySpan<Double>, Boolean) Creates a piecewise linear interpolating curve for circular/angular data.

CircularLinearCurve(Double[], Double[], Boolean)

Creates a piecewise linear interpolating curve for circular/angular data.
C#
public static PiecewiseInterpolatingCurve CircularLinearCurve(
	double[] xValues,
	double[] angles,
	bool degrees = false
)

Parameters

xValues  Double[]
The x-coordinates of the data points. Must be strictly increasing.
angles  Double[]
The angular y-coordinates of the data points.
degrees  Boolean  (Optional)
If true, angles are in degrees; otherwise, radians.

Return Value

PiecewiseInterpolatingCurve
A PiecewiseInterpolatingCurve that interpolates angular data correctly across discontinuities.

Remarks

This method creates a curve that properly handles angular data by unwrapping angles during interpolation and wrapping the output. This prevents interpolation artifacts when angles cross discontinuities (e.g., from 359° to 1° or from π to -π).

Exceptions

ArgumentNullExceptionxValues or angles is null.
DimensionMismatchException The lengths of xValues and angles do not match.
ArgumentExceptionxValues is not strictly increasing.

CircularLinearCurve(ReadOnlySpan<Double>, ReadOnlySpan<Double>, Boolean)

Creates a piecewise linear interpolating curve for circular/angular data.
C#
public static PiecewiseInterpolatingCurve CircularLinearCurve(
	ReadOnlySpan<double> xValues,
	ReadOnlySpan<double> angles,
	bool degrees = false
)

Parameters

xValues  ReadOnlySpan<Double>
The x-coordinates of the data points. Must be strictly increasing.
angles  ReadOnlySpan<Double>
The angular y-coordinates of the data points.
degrees  Boolean  (Optional)
If true, angles are in degrees; otherwise, radians.

Return Value

PiecewiseInterpolatingCurve
A PiecewiseInterpolatingCurve that interpolates angular data correctly across discontinuities.

Remarks

This method creates a curve that properly handles angular data by unwrapping angles during interpolation and wrapping the output. This prevents interpolation artifacts when angles cross discontinuities (e.g., from 359° to 1° or from π to -π).

Exceptions

DimensionMismatchException The lengths of xValues and angles do not match.
ArgumentExceptionxValues is not strictly increasing.

See Also