[net.sources] plot for fractal source which uses plot

hutch@sdcsvax.UUCP (Jim Hutchison) (07/11/85)

*** REPLACE THIS LINE WITH YOUR MESSAGE ***

Due to a number of flames and or requests I am posting this
copy of the routine plot() which does not use core.
It uses plot(3) line() instead.  The initial openpl() and
closepl() are left to the reader to use in conjunction.

/*
 * Plot_line()
 *
 * Draw a line by length and angle relative to current x,y
 *
 * Author: Jim Hutchison (hutch@sdcsvax)
 * (this is free, but credit me)
 */

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

static double crntx = 0.0, crnty = 0.0;

set_coord(x,y)
double x,y;
{
    crntx = x;
    crnty = y;
}

/*
 *	Plot a line by length and angle from current position
 */

plot_line(length,angle)
double length,angle;
{
double dx,dy;

    MOD(angle,TWOPI);

    dx = length * cos(angle);
    dy = length * sin(angle);

    line( crntx, crnty, crntx + dx, crnty + dy);
    crntx += dx;
    crnty += dy;	/* don't forget openpl() and closepl() */
}
-- 
/*
	Jim Hutchison	UUCP:	{dcdwest,ucbvax}!sdcsvax!hutch
			ARPA:	hutch@sdcsvax

    < Ofcourse these statements are only mine, not my employers. >
*/