SRC: Fractal,oops missed one!
Jim Hutchison
hutch at sdcsvax.UUCP
Tue Jul 9 16:27:27 AEST 1985
*** 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 at sdcsvax)
/*
* general()
*
* Draw a Generic Fractal curve.
*
* Author: Jim Hutchison (hutch at 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 at sdcsvax
< Ofcourse these statements are only mine, not my employers. >
*/
More information about the Comp.sources.unix
mailing list