mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.49k stars 897 forks source link

Introduce a maxDeltaT to check if referencing points are within range #994

Open Hylke-Atmos opened 1 year ago

Hylke-Atmos commented 1 year ago

Hi @cdrnet,

I ran into a situation where I wanted to have the (LinearSpline) interpolation to fail when the two points used for interpolation are not within a certain range from point 't'. I added a function which you can provide with a MaxDeltaT argument.

Please let me know if you'd like this addition for the library. It is currently implemented directly in LinearSpline, but I can imagine it might be worth for all interpolation functions. So if you like the idea I can extend it towards the IInterpolation Interface and implement it into all implementations.

Kind Regards Hylke