项目作者: NChechulin

项目描述 :
A task for Bonus Point from HSE
高级语言: C++
项目地址: git://github.com/NChechulin/spline-interpolation.git
创建时间: 2021-04-04T13:49:44Z
项目社区:https://github.com/NChechulin/spline-interpolation

开源协议:MIT License

下载


Cubic Spline Inerpolation

Task

Implement cubic spline interpolation algorithm and draw resulting a graph for a given set of 2-dimensional points

Input file format

Any text file with 2N integer or floating point values. It must not contain any other data.
If the number of points is less than 3 or if there are at least 2 points with the same X coordinate the program will show an error messagebox.

Example:

  1. -87.6083 32.7009
  2. 66.8744 42.2585
  3. 75.6633 44.6086
  4. -55.5066 28.8486
  5. 46.2896 -12.5529
  6. -51.2362 21.5556
  7. 78.5095 6.7208
  8. 95.6425 29.2169
  9. -71.4888 -7.3083
  10. -84.2601 9.0064

Screenshots

Plot constructed using the sample file (points.txt)
On the left there’s result of some online tool and the output of my program is on the right.

Project structure

  1. |-- LICENSE
  2. |-- README.md
  3. |-- points.txt - Sample file with points
  4. `-- src - Directory with source code
  5. |-- interpolation.cpp - Logic for reading data and interpolating
  6. |-- interpolation.h
  7. |-- main.cpp
  8. |-- mainwindow.cpp - View logic
  9. |-- mainwindow.h
  10. |-- mainwindow.ui - Form
  11. |-- polynomial.cpp - Class Polynomial
  12. |-- polynomial.h
  13. |-- qcustomplot.cpp - Library for plotting
  14. |-- qcustomplot.h - Library for plotting
  15. `-- spline-interpolation.pro - Qt project file