-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
45 lines (38 loc) · 1.5 KB
/
Copy pathmain.c
File metadata and controls
45 lines (38 loc) · 1.5 KB
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 <stdlib.h>
#include <math.h>
int main(int argc, char *argv[]) {
double y = 0, x = 0, n = 16, acc = 0.25;
for(y = n; y >= -n; y -= acc) {
for(x = -n; x <= n; x += acc) {
// for number on axis
if(y == -n && x == 0) printf("%.2f ", n*-1);
else if(y == n && x == 0) printf("%.2f ", n);
else if(y == 0 && x == -n) printf("%.2f ", n*-1);
else if(y == 0 && x == n) printf("%.2f ", n);
// for axis
else if(y == 0 || x == 0) printf("* ");
// the graph
// else if(x == 9) printf("# "); // x
// else if(x + y == -8) printf("# "); // x + y
else if(y > pow(x, 2)) printf("# "); // x^2
// else if(y > pow(2, x)) printf("# ");
// else if(y > pow(x, 3)) printf("# "); // x^3
// else if(x == pow(y, 2)) printf("# "); // y^2
// else if(pow(y, 2) + pow(x, 2) <= 64) printf("# "); // x^2 + y^2
// else if(y > exp(x)) printf("# "); // e^x
// else if(y > log(x)) printf("# "); // log(x)
// else if(y > sqrt(x)) printf("# "); // sqrt(x)
// else if(y >= sin(x)) printf("# ");
// else if( 1 >= 2 * cos(pow(x, 2) + pow(y, 2)) ) printf("# ");
// else if(sin(log(pow(x, y))) > 0 || sin(log(pow(y, x))) > 0) printf("# "); //
// else if( tan(pow(x, 2) + pow(y, 2)) >= 1 ) printf("# ");
// else if( sin(pow(x, 2)) >= sin(pow(y, 2)) ) printf("# ");
else printf(" ");
}
printf("\n");
// Sleep(30);
}
// system("CLS");
return 0;
}