-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInterpolation.cpp
58 lines (49 loc) · 945 Bytes
/
Interpolation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include<bits/stdc++.h>
using namespace std;
class NewtonInterpolation
{
public:
void askN();
void askX();
void askF();
void askXX();
void forwardTable();
void calcfrd();
void calcbkrd();
void findH();
void findS();
private:
double XX, x[10] , f[10][10] , p[10];
double diff[5][5], P1;
int num;
double h,s;
};
void NewtonInterpolation::askX()
{
int n;
cin>>n;
cout << endl;
for(int i = 0; i<n; i++ )
{
cout << "Enter X[" << i << "] : ";
cin >> x[i];
}
cout << endl;
}
void NewtonInterpolation::askF()
{
int n;
cin>>n;
cout<<endl;
for(int j=0; j<n; j++)
{
cout << "Enter F[" << j << "] : ";
cin >> f[0][j];
}
cout << endl;
}
void NewtonInterpolation::askXX()
{
cout << "Enter X for which the value is to be found: ";
cin >> XX;
}