From 4314729ddef28cb619ce97d50f0968ca24c93803 Mon Sep 17 00:00:00 2001 From: rsc Date: Wed, 14 Apr 2004 19:54:10 +0000 Subject: Add graph, plot --- src/cmd/plot/libplot/range.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/cmd/plot/libplot/range.c (limited to 'src/cmd/plot/libplot/range.c') diff --git a/src/cmd/plot/libplot/range.c b/src/cmd/plot/libplot/range.c new file mode 100644 index 00000000..c4485560 --- /dev/null +++ b/src/cmd/plot/libplot/range.c @@ -0,0 +1,11 @@ +#include "mplot.h" +void range(double x0, double y0, double x1, double y1){ + e1->xmin = x0; + e1->ymin = y0; + e1->scalex = e1->sidex / (x1 - x0 ); + e1->scaley = e1->sidey / (y1 - y0 ); + e1->quantum=e0->quantum/sqrt(e1->scalex*e1->scalex + + e1->scaley*e1->scaley); + if(e1->quantum < .01) + e1->quantum = .01; +} -- cgit v1.2.3