xref: /csrg-svn/lib/libplot/grn/subr.c (revision 61391)
148511Sbostic /*-
2*61391Sbostic  * Copyright (c) 1980, 1986, 1993
3*61391Sbostic  *	The Regents of the University of California.  All rights reserved.
448511Sbostic  *
548511Sbostic  * %sccs.include.proprietary.c%
629817Ssklower  */
729817Ssklower 
829817Ssklower #ifndef lint
9*61391Sbostic static char sccsid[] = "@(#)subr.c	8.1 (Berkeley) 06/04/93";
1048511Sbostic #endif /* not lint */
1129817Ssklower 
1229817Ssklower #include "grnplot.h"
1329817Ssklower 
1429817Ssklower 
1529817Ssklower /*---------------------------------------------------------
1629817Ssklower  *	This local routine outputs an x-y coordinate pair in the standard
1729817Ssklower  *	format required by the grn file.
1829817Ssklower  *
1929817Ssklower  *	Results:	None.
2029817Ssklower  *
2129817Ssklower  *	Side Effects:
2229817Ssklower  *
2329817Ssklower  *	Errors:		None.
2429817Ssklower  *---------------------------------------------------------
2529817Ssklower  */
outxy(x,y)2629817Ssklower outxy(x, y)
2729817Ssklower int x, y;			/* The coordinates to be output.  Note:
2829817Ssklower 				 * these are world coordinates, not screen
2929817Ssklower 				 * ones.  We scale in this routine.
3029817Ssklower 				 */
3129817Ssklower {
3229817Ssklower     printf("%.2f %.2f\n", (x - xbot)*scale,(y - ybot)*scale);
3329817Ssklower }
3429817Ssklower 
outcurxy()3529817Ssklower outcurxy()
3629817Ssklower {
3729817Ssklower 	outxy(curx,cury);
3829817Ssklower }
3929817Ssklower 
startvector()4029817Ssklower startvector()
4129817Ssklower {
4229817Ssklower 	if (!ingrnfile) erase();
4329817Ssklower 	if (invector) return;
4429817Ssklower 	invector = 1;
4529817Ssklower 	printf("VECTOR\n");
4629817Ssklower 	outcurxy();
4729817Ssklower }
4829817Ssklower 
endvector()4929817Ssklower endvector()
5029817Ssklower {
5129817Ssklower 	if (!invector) return;
5229817Ssklower 	invector = 0;
5329817Ssklower 	printf("*\n%d 0\n0\n",linestyle);
5429817Ssklower }
55