[comp.sys.handhelds] Fractal tree program for the HP48SX

ctalbot@lucpum.UUCP (Carlos J. Talbot) (11/21/90)

Here's a program I translated from some C code in the book "Fractal
Programming in C" by Roger T. Stevens.  It asks for 6 variables:
1) Height:  This is the height of the trunk in pixels. 2) Left alpha:
This is some number from 1 to 5.  The higher the number the longer
the branches extend. 3) Right alpha:  Same goes for this one.
4) Left angle:  The higher the angle the greater the curvature of
the branches.  5) Right angle:  Ditto for this one.  6) Recursion
level:  The higher the number, the greater the detail(more branches).
I wouldn't try a number higher than 14 because the twigs become too
small to distinguish.  I've also included a PICT file named 'TREE'.
To view place 'TREE' on stack, then PICT, then press STO.  Next go into
graph.  This tree was generated with the parameters:12,2,2.2,20,28,10.
This took about 25 minutes to draw!  Here's a list of parameters you
might try.

Height Left alpha  Right alpha Left Angle  Right Angle  Recursion
------ ----------  ----------- ----------  -----------  ---------
  12       2.0        2.2         24           26           6
  35       2.0        0.00001     55            0          10
  13       3.0        3.0         33           33           9
  25       1.2        1.2         90           90           6

Note: This is my first post and unfortunately I do not have ASC->
so I uuencoded the HP binary file.


begin 644 tree
M2%!(4#0X+4*6*O!_!Q$    $5%523@2=+>!A(U0V@N0"!71U<G1T>3;2NQ]+
M!))C(RLQ4 0 !5135$50!9TMX&$C5#:"Y (%='5R='AY-H*K D@N4$!7)T<G
MA^0"!71U<G1T,RF F0  DC)%%^#>&@6UX=X:*S&P1"!4-H+D @5T=7)T>7DV
M@JL"2"Y00%<G1R>'Y (%='5R='0S*8"9  "2,D47X-X:K+3AWAHK,;!$(#DV
MLA(# @% 0"555$3@L0*/"  $ (,                                 
M                                                            
M                                "G\                  .C__PL 
M                _O__/P               .#_____                
M_/____\#              #______P<             @/_____O'P      
M      # ______]_             .#W___W__\!            ^/______
M_P$           "\_^_OW___!P           /Z_?_W___\/            
M__?_S_OW[Q\          (#_/Y_^__O]/P          @/\OO_F__?]_    
M      # _SS5B&O__W\          , [T;&(R_G[?P          X/\1$84I
MR;__          #@,Q,2A1;___\!         / C'!*"_OFS_P,         
M\%\0#$*'SH__ P        #P8B ,PH3U^_<#         &B#( @D1,C__P< 
M        > 1!""0HJ)/_!P        #XCT\(%"CX\_<'         'AP\! 8
M&.C1[P\         N \ $P@(V+#]!P        !X!  <" A\^.\/        
M # # ! (" @V]@\         \ ( ( 0(] '\#P        !@ 0! ! @.!KH/
M         * ! ( $A 'X_P\         0 $ @ 1$ "#D#P           P  
M R0 0+@/               "' ! \ X               ($ ("Y#P      
M        ! ( @/X%               $ @  ^0,               @!  #I
M P              " $  -L#              "(  " ^@$             
M )   (#>                4   ^/H               !@  "H?P      
M         "   ' ?                (   8 \                @    
M                 "                      (                   
M   @                     "                      (           
M           @                     "                      (   
M                   @                     "                  
M    (                                   B@ %4$])3E0%G2W@82/!
M--+F @)X,6TN() 7T^8" G@R;2X@D"?C82/#+H*K FTN(( GT^8" G@Q":U!
M*RIRZ;$2 _HNTMD"PRZ"JP)M+B"0)]/F @)Y,5WLL1(#^BXRDP(!        
M";4O,I," @      < +5+[(2 [4OTMD";2X@D"?3Y@(">3$)K='F @)X,FTN
M(( 7D] :!:_!>1LS*1    !Y5RE7X-X:*S%0_2+#+H*K FTN(( 7T^8" G@R
M7>RQ$@/Z+M+9 C,I(        !APMAHK,5#](OXUDF,C*S&0'  (1T5.15)!
M5$4(G2W@82.THD(K*L$TTN8" 7AM+A"0U^8"!FAE:6=H=&TN4!#F=L96UN8"
M!6QE=F5L;2X@@!?3Y@(">3$>-M+F @%X5#:"Y (%='5R='AY-M+,(&TN$)!'
M92-(+E! 5R='EY=G(\T,TN8"!FAE:6=H=%0V@N0"!71U<G1R>3;2S"!(+E! 
M-455!(7D @5T=7)T>%0VTN8" G@Q>3;2S"!(+E! 5R='ET=E(VTN() 7DV<C
MS0Q"92-M+E# 5F97QI9G(\FB@E,@;2X0@-?F @%Y;2X@@!?3Y@(">3%(+E! 
MQ)3D5#3L(K@JT.8"!6QE=F5LM*+2Q1XK,:#O(ITMT.8" 7AM+A"0U^8" G@Q
M;2X@D!>#Y (%4$])3E14-H+D @5T=7)T='DVTLP@2"Y0P&86YG:&Y ($5%52
M3D@N4$!7)T>'A^0"!71U<G1Y2"XPP(9FUN8"!FAE:6=H=.ZM@>0"!6QF86YG
M;2Y0P%9F5\:&Y ((1T5.15)!5$5M+A" U^8" 7EM+B" %]/F @)Y,4@N4 #U
ME.1$164C2"Y00%<G1T>79R/-#(+D @5R=&%N9Y6I@>0"!%154DYM+B" %]/F
M @)Y,4@N,,"&9M;F @9H96EG:'3NK8'D @5R=&%N9VTN4,!69E?&AN0""$=%
M3D52051%*S%0_2+^-9)C(RLQ$$$ !41,24Y%!9TMX&$CP332Y@(">#%M+B"0
M%]/F @)X,FTN() GXV$C;2X@@!<SDP(!      !0!F>KL6D9,RD0        
M,M#F @)Y,0FML6D9WJ(R>!QM+B" )S.3 @$      % &9ZNQ:1DS*1      
M   RT.8" GDR":VQ:1G>HC)X')CCX5\C.3:R$@,> 4#0%)3D1-#9 AXVDF$<
ML*-")QPS*1         722<<,RD0        &%DM'%BH\24>+"IP @!%3E1%
M4B!35$5-($A%24=(5"PJ4   RB2R]QPL*M ! $5.5$52($Q%1E0@C"PJ4   
MRB2R]QPL*O ! $5.5$52(%))1TA4((PL*E   ,HDLO<<+"KP @!%3E1%4B!,
M1494($)20T@N($%.1RXL*E   ,HDLO<<+"KP @!%3E1%4B!22%0N($)20T@N
M($%.1RXL*E   ,HDLO<<+"K0 @!%3E1%4B!214-54E-)3TX@3%9,+BPJ4   
MRB2R]QQ4-H+D @5L979E;'DVTLP@5#:"Y (%<G1A;F=Y-M+,(%0V@N0"!6QF
M86YG>3;2S"!4-H+D @5R=&%L<'DVTLP@5#:"Y (%;&9A;'!Y-M+,(%0V@N0"
M!FAE:6=H='DVTLP@M*)"*RJTHD(K*E0V@N0"!71U<G1T>3;2S"!4-H+D @5T
M=7)T<GDVTLP@5#:"Y (%='5R='EY-M+,(%0V@N0"!71U<G1X>3;2S"!T*N"D
M A4           #@I (5            L!(#\.)!*RHS*1         P22LJ
MM*(23"-M+A" U^8" 7EM+B" %]/F @)Y,1XV@JL"2"XPP(9FYBTJFZ,R+RI(
M+E# 9A;&!N?>&@6OT0(;V*BQ$@-E#8*K D@N,""'9N8M*INC,B\J2"Y0($<7
MQ@;GWAH%K]$"&]BHL1(#90V"JP)M+B"0%]/F @%Y2"Y@@%:6=H9&=[8:V*BQ
M$@-E#8*K FTN$(#7Y@(!>6TN(( 7T^8" GDQN"J Y (%1$Q)3D4K,7 !!$#V
ML1(#OJ/1Y@(!>&TN$)#7Y@(">#%M+B"0%X/D @503TE.5%0V@N0"!71U<G1T
M>3;2S"!(+E# 9A;F=H;D @1455).;2X@@!?3Y@(">3%(+C# AF:&Y (&:&5I
M9VAT[JV!Y (%;&9A;F=(+E# 5F97QH;D @A'14Y%4D%416TN$(#7Y@(!>6TN
M(( 7T^8" GDQ2"Y0 /64Y$1%92-(+E! 5R='1Y=G(\T,@N0"!7)T86YGE:F!
MY ($5%523FTN(( 7T^8" GDQ2"XP((=FAN0"!FAE:6=H=.ZM@>0"!7)T86YG
M2"Y0P%9F5\:&Y ((1T5.15)!5$7^-4*G D@N,""'9H;D @-L:&9(+F" 5I9V
MAD:'Y (%;&9A;'!(+E @1Q?&!H?D @5L9F%N9T@N4"!'%^9VAN0"!6QE=F5L
M2"Y00%<G1T>'Y (%='5R=')(+E! 5R='EX?D @5T=7)T>"LQX.\@?\9!IP(K
),0 O'CDVLA(#
 
end

Carlos Talbot
Unix Support
Loyola University Chicago
lucpum!ctalbot@gargoyle.uchicago.edu