Click or drag to resize
DigitalRunePath2FGetParameterFromLength Method
Gets the curve parameter for the given curve length (for length-parameterized splines).

Namespace: DigitalRune.Mathematics.Interpolation
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public float GetParameterFromLength(
	float length,
	int maxNumberOfIterations,
	float tolerance
)

Parameters

length
Type: SystemSingle
The length.
maxNumberOfIterations
Type: SystemInt32
The maximum number of iterations which are taken to compute the length.
tolerance
Type: SystemSingle
The tolerance value. This method will return an approximation of the precise parameter. The absolute error will be less than this tolerance.

Return Value

Type: Single
The parameter at which the curve has the given length.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptiontolerance is negative or 0.
Remarks

This method assumes that the spline is length-parameterized; This means: The parameter of a key is equal to the length of the spline at this key. If this is not the case, ParameterizeByLength(Int32, Single) can be called to correct the key parameters automatically.

Normally, the spline curve parameter is not linearly proportional to the length. Therefore, if the point at a given curve length is required, this method can be used to compute the curve parameter which will return the point for the given distance. The result of this method can be used in GetPoint(Single).

This method uses an iterative algorithm. The iterations end when the maxNumberOfIterations were performed, or when the tolerance criterion is met - whichever comes first.

See Also