Skip to content

Option to use cubic spline interpolation instead of linear splines #170

@richardlett

Description

@richardlett

What is the feature ?

It appears that interpolating between points currently uses linear splines. Using free cubic splines could give smoother looking plots.

(Optional) Why this feature is useful and how people would use the feature ?

I think they look nicer. Free splines often more representative for functions which are continuous. If I remember, correctly, if X is the max of the second derivative on the interval, then linear splines have max error |X|h^2/8, where h is the distance between points.

I'm not sure how they arrived at it, but this document says cubic splines has the error |X| * 5/384*h^4, where X is the max of the fourth derivative on the interval

Here's a comparison of linear vs cubic for a sine function.

image

  • Here is an algorithm for natural cubic splines.

I would be happy to take this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions