odstraneni komentaru
This commit is contained in:
parent
474180e790
commit
5c0b36a419
28
main.c
28
main.c
@ -14,41 +14,21 @@ int main(int argc, char *argv[]) {
|
|||||||
return 1;
|
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]);
|
lex = lex_create(argv[1]);
|
||||||
|
|
||||||
node = parse_expression(lex);
|
node = parse_expression(lex);
|
||||||
lex_free(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) {
|
if (node) {
|
||||||
FILE *file;
|
FILE *file;
|
||||||
struct graph_range graph;
|
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.xmin = -20.0;
|
||||||
graph.xmax = 3.14;
|
graph.xmax = 20.0;
|
||||||
graph.ymin = -1;
|
graph.ymin = -20.0;
|
||||||
graph.ymax = 1;
|
graph.ymax = 20.0;
|
||||||
graph.step = 0.01;
|
graph.step = 0.01;
|
||||||
|
|
||||||
|
|
||||||
file = fopen("out.ps", "w");
|
file = fopen("out.ps", "w");
|
||||||
ps_export_graph(file, node, &graph);
|
ps_export_graph(file, node, &graph);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user