odstraneni komentaru

This commit is contained in:
tovjemam 2024-11-12 11:38:26 +01:00
parent 474180e790
commit 5c0b36a419

28
main.c
View File

@ -14,41 +14,21 @@ int main(int argc, char *argv[]) {
return 1;
}
/*
//struct lexer *lex = lex_create("x* sin (x ^ 2) * 5.5e+2* cosh (x )");
//struct lexer *lex = lex_create("-1 + -2 - 3 + 4");
*/
lex = lex_create(argv[1]);
node = parse_expression(lex);
lex_free(lex);
//if (node) {
// double x;
// node_debug_print(node);
// printf("polygon(");
// for (x = -10.0; x < 10.0; x += 0.1) {
// printf("(%.2f,%.2f),", x, node_eval(node, x));
// }
// printf("(10, -1000),(-10,-1000))\n");
//}
if (node) {
FILE *file;
struct graph_range graph;
//graph.xmin = -10.0;
//graph.xmax = 10.0;
//graph.ymin = -10.0;
//graph.ymax = 10.0;
//graph.step = 0.1;
graph.xmin = -3.14;
graph.xmax = 3.14;
graph.ymin = -1;
graph.ymax = 1;
graph.xmin = -20.0;
graph.xmax = 20.0;
graph.ymin = -20.0;
graph.ymax = 20.0;
graph.step = 0.01;
file = fopen("out.ps", "w");
ps_export_graph(file, node, &graph);
fclose(file);