Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sdcsvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittvax!dcdwest!sdcsvax!hutch From: hutch@sdcsvax.UUCP (Jim Hutchison) Newsgroups: net.sources Subject: SRC: Fractal,oops missed one! Message-ID: <962@sdcsvax.UUCP> Date: Tue, 9-Jul-85 02:27:27 EDT Article-I.D.: sdcsvax.962 Posted: Tue Jul 9 02:27:27 1985 Date-Received: Thu, 11-Jul-85 20:23:02 EDT Organization: UCSD EMU Project (Educational Microcomputer Unix) Lines: 50 *** 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#include #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. > */