Created
October 14, 2016 20:34
-
-
Save Hajto/b0ebb3274ea11c3eb21428115304755b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#define IT_COUNT 1001 | |
//tablicowanie fcji sin w <a,b> - szereg + fcja biblioteczna | |
//definicja funkcji szereg x - parametr formalny | |
double szereg_rek(double x, double it){ | |
if( it >= IT_COUNT) | |
return x; | |
else | |
return 1 - (((it-2)*(it-2)*x*x) / ((it-1)*it)*szereg_rek(x,it+2)); | |
} | |
double szereg_reks(double x){ | |
return x*szereg_rek(x, 3); | |
} | |
int main(int argc, char *argv[]){ | |
int lp; | |
double a, b, szsin, krok, x; | |
//Stdin | poczatek koniec liczba_przedzialow | |
printf("podaj konce przedzialow i liczbe podprzedzialow\n"); | |
scanf("%lf %lf %d",&a,&b,&lp); | |
krok=(b-a)/lp; | |
printf("krok=%6.2lf\n\n\n",krok); | |
printf(" ----------------------------\n\n"); | |
printf(" x szereg(x) asinh(x)\n ----------------------------\n"); | |
for (x=a;x<=b;x+=krok) | |
printf("%10.2lf %7.4lf %7.4lf\n",x,szereg_reks(x),asinh(x)); | |
printf(" ----------------------------\n\n"); | |
system("PAUSE"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment