aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/plot/libplot/range.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-14 19:54:10 +0000
committerrsc <devnull@localhost>2004-04-14 19:54:10 +0000
commit4314729ddef28cb619ce97d50f0968ca24c93803 (patch)
tree3abd7849a10e842a57b1fd535f8278d22a6bf132 /src/cmd/plot/libplot/range.c
parent6e18e03e63942f7b0912bb91d0da02fd493af0af (diff)
downloadplan9port-4314729ddef28cb619ce97d50f0968ca24c93803.tar.gz
plan9port-4314729ddef28cb619ce97d50f0968ca24c93803.tar.bz2
plan9port-4314729ddef28cb619ce97d50f0968ca24c93803.zip
Add graph, plot
Diffstat (limited to 'src/cmd/plot/libplot/range.c')
-rw-r--r--src/cmd/plot/libplot/range.c11
1 files changed, 11 insertions, 0 deletions
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;
+}