https://github.com/ahotko/mathextended.interpolation
Pure C# Library with some Interpolations (2D)
https://github.com/ahotko/mathextended.interpolation
csharp csharp-library interpolation interpolations
Last synced: 10 months ago
JSON representation
Pure C# Library with some Interpolations (2D)
- Host: GitHub
- URL: https://github.com/ahotko/mathextended.interpolation
- Owner: ahotko
- License: mit
- Created: 2018-04-10T07:31:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-06T11:09:19.000Z (almost 6 years ago)
- Last Synced: 2025-05-29T19:59:00.615Z (about 1 year ago)
- Topics: csharp, csharp-library, interpolation, interpolations
- Language: C#
- Size: 78.1 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MathExtended.Interpolation
Pure C# Interpolation (2D) Library (Playground). It is a C# rewrite of my old Delphi Interpolation Library.
## Legal information and credits
MathExtended.Interpolation is project by Ales Hotko and was first released in April 2018. It's licensed under the MIT license.
## Usage
```csharp
using MathExtended.Interpolations;
var interpolation = new Interpolation();
interpolation.Add(1, 2);
interpolation.Add(5, 8);
interpolation.Add(7.7, 5);
interpolation.Add(10, 15);
interpolation.Add(11, 11.3);
//Linear interpolation
double interpolatedValueLinear = interpolation.Linear(3.5);
//...or...
interpolation.Linear();
double interpolatedValueLinear = interpolation.Interpolate(3.5);
//Spline interpolation
double interpolatedValue = interpolation.Spline(3.5);
//...or...
interpolation.Spline();
double interpolatedValue = interpolation.Interpolate(3.5);
//Cosine interpolation
double interpolatedValue = interpolation.Cosine(3.5);
//...or...
interpolation.Cosine();
double interpolatedValue = interpolation.Interpolate(3.5);
```
## Optional parameters and overloads
All classes have overloaded constructors and overloaded `Add` methods, that take:
* Single X and Y value - `Add(double ValueX, double ValueY)`
* Dictionary of X and Y values - `Add(Dictionary Values)`
* Arrays of X and Y values `Add(double[] ValuesX, double[] ValuesY)`