Open richardlett opened 3 years ago
Hi there, thanks for the suggestion. This is planned for a long time, and I am going to visit it soon, hopefully we will get it with the next major release. - Cheers
If someone starts working on this, I would suggest to include Constraint Cubic Splines, too, since they provide curves which look similar smooth (though mathematically they aren't, since they are not everywhere differentiable), but avoid the overshooting problem of Standard Cubic Splines, see e.g. here: constraint cubic spline
I'm really interested in this feature as well.
@AaronErhardt is it acceptable to implement this feature using a dependency like this one?
In case it is, I can give it a try.
@AaronErhardt is it acceptable to implement this feature using a dependency like this one?
Yes, but it's probably better to add a feature flag then so that the spline dependency is only compiled when needed.
Yes, but it's probably better to add a feature flag then so that the spline dependency is only compiled when needed.
Yeah, that's what I was thinking about as well. I'll give it a try when I have some available time then.
Update: for my use case, I've solved by just building the spline myself and passing a sampled spline as vector of points to plotters. This way I can accurately choose where to sample it and with which frequency, the interpolation type and so on. So in the end, I think there is actually no strict need to include this feature in plotters itself.
I would definitely use this feature if implemented. :D
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/384h^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.
I would be happy to take this issue.