ianmackenzie / elm-geometry-prerelease / Curve.ArcLengthParameterization

You will likely never need to use this module directly. In the vast majority of cases the individual curve modules such as QuadraticSpline2d should contain all the functionality you need to construct an arc length parameterization and use it to do things like evaluate a curve at evenly-spaced points. This module is primarily for use internally by those curve modules, but may be useful if you want to do some fancy mapping between arc length and curve parameter values.


type ArcLengthParameterization

Contains a mapping from curve parameter value to arc length, and vice versa.

Constructing

build : { maxError : Basics.Float, derivativeMagnitude : Curve.ParameterValue.ParameterValue -> Basics.Float, maxSecondDerivativeMagnitude : Basics.Float } -> ArcLengthParameterization

Build an arc length parameterization for some curve. You must supply:

Evaluating

totalArcLength : ArcLengthParameterization -> Basics.Float

Find the total arc length of some curve given its arc length parameterization;

ArcLengthParameterization.totalArcLength
    parameterization

is equivalent to

ArcLengthParameterization.parameterValueToArcLength
    ParameterValue.one
    parameterization

but is more efficient.

arcLengthToParameterValue : Basics.Float -> ArcLengthParameterization -> Maybe Curve.ParameterValue.ParameterValue

Convert an arc length to the corresponding parameter value. If the given arc length is less than zero or greater than the total arc length of the curve (as reported by totalArcLength), returns Nothing.

parameterValueToArcLength : Curve.ParameterValue.ParameterValue -> ArcLengthParameterization -> Basics.Float

Convert a parameter value to the corresponding arc length.