Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double tn(int,double);
- int main(){
- double eps, x1 = 1.1, x2 = 3.1, dx;
- cout << "Enter eps, dx:";
- cin >> eps >> dx;
- for (double x = x1; x <= x2; x = x + dx){
- double f = 1.57;int n = 0;
- while (abs(tn(n,x))>=eps) {
- f += tn(n,x);
- n++;
- }
- cout << x << "\t" << atan(x) << "\t" << "F(" << x << ")=" << f<< endl;
- }
- system("pause");
- return 0;
- }
- double tn(int n1,double x1){
- return pow((-1.0),(n1+1))/((2*n1+1)*pow(x1,2*n1+1));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement