xref: /csrg-svn/lib/libplot/grn/subr.c (revision 48511)
1*48511Sbostic /*-
2*48511Sbostic  * Copyright (c) 1980, 1986 The Regents of the University of California.
3*48511Sbostic  * All rights reserved.
4*48511Sbostic  *
5*48511Sbostic  * %sccs.include.proprietary.c%
629817Ssklower  */
729817Ssklower 
829817Ssklower #ifndef lint
9*48511Sbostic static char sccsid[] = "@(#)subr.c	6.2 (Berkeley) 04/22/91";
10*48511Sbostic #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  */
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 
3529817Ssklower outcurxy()
3629817Ssklower {
3729817Ssklower 	outxy(curx,cury);
3829817Ssklower }
3929817Ssklower 
4029817Ssklower startvector()
4129817Ssklower {
4229817Ssklower 	if (!ingrnfile) erase();
4329817Ssklower 	if (invector) return;
4429817Ssklower 	invector = 1;
4529817Ssklower 	printf("VECTOR\n");
4629817Ssklower 	outcurxy();
4729817Ssklower }
4829817Ssklower 
4929817Ssklower endvector()
5029817Ssklower {
5129817Ssklower 	if (!invector) return;
5229817Ssklower 	invector = 0;
5329817Ssklower 	printf("*\n%d 0\n0\n",linestyle);
5429817Ssklower }
55