-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.c
More file actions
45 lines (29 loc) · 734 Bytes
/
Copy pathfunctions.c
File metadata and controls
45 lines (29 loc) · 734 Bytes
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
#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979323846
double aniezi(double x);
double bernulli(double x);
double gip(double x);
int main(){
double pi = PI;
for (int i = 0; i < 42; i++){
double step = -pi + (2 * pi / 41) * i;
double a = aniezi(step);
double b = bernulli(step);
double c = gip(step);
printf("%.7lf |", step);
printf("%.7lf |", a);
printf("%.7lf |", b);
printf("%.7lf\n", c);
}
return 0;
}
double aniezi(double x){
return (pow(1, 3) / (pow(1, 2) + x * x));
}
double bernulli(double x){
return sqrt((sqrt(pow(1, 4) + 4 * pow(x, 2) * 1)) - x * x - 1);
}
double gip(double x){
return 1 / (x * x);
}