Skip to content

Improve monotonic cubic spline interpolation #146

@stfnp

Description

@stfnp

Standard cubic splines minimize an integral over the squared curvature to obtain the "smoothest" possible curve through the supplied control points. Things get more complicated when the spline must also preserve the monotonicity of the input data, like the width and height interpolation in VirtualBow. The current implementation (based on the example code in https://en.wikipedia.org/wiki/Monotone_cubic_interpolation) is a compromise that preserves the monotonicity of the input data, while not necessarily leading to the smoothest curve to do so.

There are other methods based on numerical optimization [1] that find the actual minimum curvature (i.e. produce better/smoother results) while still preserving monotonicity. The increased computational cost wouldn't be that important, because those things are only calculated once prior to running the simulation.

[1] Wolfberg, Alfy: Monotonic cubic spline interpolation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions