[net.sources] SRC: Fractal,oops missed one!

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

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

Of course you will need the rest for this to make sense,
but it is small so I posted it here quickly as possible.
This goes with the Gosper,Koch,and Monkey Fractals.

		-Jim Hutchison	(hutch@sdcsvax)

/*
 * general()
 *
 * Draw a Generic Fractal curve.
 *
 * Author: Jim Hutchison (hutch@sdcsvax)
 * (this is free, but credit me)
 */

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

general(len,angle,min_len,scale,flip,shape,size)
double len,angle,min_len,scale;
int flip;
GEN *shape;
int size;
{
register int i;
GEN *gp;

    if (len > min_len) {				/* draw generator */
	gp = shape + ((flip == 1)? 0 : size );
	for(i = 0 ; i < GEN_SIDES ; i++, gp += flip)
	    general(len/gp->div,
		   angle + gp->angle,
		   min_len,
		   scale * gp->scale,
		   gp->flip * flip);

    } else			/* draw side */
	plot_line(len * scale, angle);
}
-- 
/*
	Jim Hutchison	UUCP:	{dcdwest,ucbvax}!sdcsvax!hutch
			ARPA:	hutch@sdcsvax

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