Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/tex/tpic/libtex/arc.c

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


#include <math.h>
#include "tex.h"

devarc(x1, y1, x2, y2, xc, yc, r)
double x1, y1, x2, y2, xc, yc;
int r;
{
	double t, start, stop;
	int rad;

	/* tpic arcs go clockwise, and angles are measured clockwise */
	start = atan2(y2-yc, x2-xc);
	stop = atan2(y1-yc, x1-xc);
	if (r<0) {
		t = start; start = stop; stop = t;
	}
	rad = SCX(sqrt((x1-xc)*(x1-xc)+(y1-yc)*(y1-yc)));
	fprintf(TEXFILE, "    \\special{ar %d %d %d %d %6.3f %6.3f}%%\n",
		TRX(xc), TRY(yc), rad, rad, -start, -stop);
}

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.