xref: /csrg-svn/lib/libplot/grn/circle.c (revision 29806)
1*29806Ssklower /*
2*29806Ssklower  * Copyright (c) 1980, 1986 Regents of the University of California.
3*29806Ssklower  * All rights reserved.  The Berkeley software License Agreement
4*29806Ssklower  * specifies the terms and conditions for redistribution.
5*29806Ssklower  */
6*29806Ssklower 
7*29806Ssklower #ifndef lint
8*29806Ssklower static char sccsid[] = "@(#)circle.c	6.1 (Berkeley) 08/29/86";
9*29806Ssklower #endif not lint
10*29806Ssklower 
11*29806Ssklower 
12*29806Ssklower #include "grnplot.h"
13*29806Ssklower 
14*29806Ssklower /*---------------------------------------------------------
15*29806Ssklower  *	Circle draws a circle.
16*29806Ssklower  *
17*29806Ssklower  *	Results:	None.
18*29806Ssklower  *
19*29806Ssklower  *	Side Effects:
20*29806Ssklower  *	A circle of radius r is drawn at (x,y).
21*29806Ssklower  *	The current position is set to (x,y);
22*29806Ssklower  *---------------------------------------------------------
23*29806Ssklower  */
24*29806Ssklower circle(x, y, r)
25*29806Ssklower int x, y, r;
26*29806Ssklower {
27*29806Ssklower 	if (!ingrnfile) erase();
28*29806Ssklower 	endvector();
29*29806Ssklower 	printf("ARC\n");
30*29806Ssklower 	outxy(x,y);
31*29806Ssklower 	outxy(x+r,y);
32*29806Ssklower 	outxy(x,y+r);
33*29806Ssklower 	outxy(x,y-r);
34*29806Ssklower 	outxy(x+r,y);
35*29806Ssklower 	outxy(x-r,y);
36*29806Ssklower 	printf("*\n%d 0\n0\n",linestyle);
37*29806Ssklower 	curx=x;
38*29806Ssklower 	cury=y;
39*29806Ssklower }
40