Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site mecc.UUCP Path: utzoo!linus!philabs!prls!amdimage!amdcad!amd!pesnta!hplabs!intelca!qantel!ihnp4!stolaf!umn-cs!mmm!rosevax!dicomed!mecc!sewilco From: sewilco@mecc.UUCP (Scot E. Wilcoxon) Newsgroups: net.sources Subject: Relative plot_line (fractal followup) Message-ID: <333@mecc.UUCP> Date: Wed, 24-Jul-85 16:54:23 EDT Article-I.D.: mecc.333 Posted: Wed Jul 24 16:54:23 1985 Date-Received: Tue, 30-Jul-85 05:19:30 EDT References: <267@sdcc13.UUCP> Reply-To: sewilco@mecc.UUCP (Scot E. Wilcoxon) Organization: MN Ed Comp Corp, St.Paul, MN Lines: 100 Keywords: fractals graphics My problem when trying to use the recently posted fractal curve generators is probably moderately common for we on smaller machines... No routine to draw a line relative to the current point. Here's a version of plot_point which only needs a line-drawing routine, and a suggestion of where to put system- dependent definitions. ------------------You've got to cut somewhere. Try here. ----------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # System.h # plot.c # This archive created: Wed Jul 24 15:13:43 1985 export PATH; PATH=/bin:$PATH if test -f 'System.h' then echo shar: will not over-write existing file "'System.h'" else cat << \SHAR_EOF > 'System.h' /* * System.h * * System-dependent constants for convenience when doing radial fractal work * * Author: Scot E. Wilcoxon (mecc!sewilco) */ #ifndef SYSFUN #define SYSFUN #define XENIX3 /* We're using the peculiarities of XENIX 3.0 */ #define NORLINE /* No Relative Line in the Lisa */ #include "../graphics.h" /* Let's not forget local graphic values */ #endif SHAR_EOF fi # end of overwriting check if test -f 'plot.c' then echo shar: will not over-write existing file "'plot.c'" else cat << \SHAR_EOF > 'plot.c' /* * Plot_line() * * Draw a line by length and angle relative to current x,y * * Modifier: Scot E. Wilcoxon (mecc!sewilco) * (works for me, and it is free) * * Author: Jim Hutchison (hutch@sdcsvax) * (this is free, but credit me) */ #include "System.h" #ifdef SUNSYS #include /* This is probably for SUN's Suncore graphics. */ #endif #include #include "g.h" /* * Plot a line by length and angle from current position */ plot_line(length,angle) double length,angle; { #ifdef NORLINE static double xhere = (MAXX / 2.0) ; static double yhere = (MAXY / 2.0) ; #endif double dx,dy; MOD(angle,TWOPI); dx = length * cos(angle); dy = length * sin(angle); #ifndef NORLINE line_rel_2( dx, dy); #else line ((int)xhere, (int)yhere, (int)(xhere+dx), (int)(yhere+dy), opr_clr); xhere+=dx; yhere+=dy; #endif } SHAR_EOF fi # end of overwriting check # End of shell archive exit 0 ---------------- Enjoy. Fractal a leg. Scot E. Wilcoxon Minn. Ed. Comp. Corp. circadia!mecc!sewilco 45N03',93W15' (612)481-3507 {ihnp4,mgnetp,uwvax}!dicomed!mecc!sewilco