Plan 9 from Bell Labs’s /usr/web/sources/patch/plot-range-ck/range.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include "mplot.h"
void range(double x0, double y0, double x1, double y1){
	double d;

	e1->xmin = x0;
	e1->ymin = y0;
	d = x1 - x0;
	if(d == 0)
		sysfatal("degenerate x range%g - %g", x1, x0);
	e1->scalex = e1->sidex / d;
	d = y1 - y0;
	if(d == 0)
		sysfatal("degenerate y range %g - %g", y1, y0);
	e1->scaley = e1->sidey / d;
	e1->quantum=e0->quantum/sqrt(e1->scalex*e1->scalex +
		e1->scaley*e1->scaley);
	if(e1->quantum < .01)
		e1->quantum = .01;
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.