; a309873.l - Xfractint L-system for turns by the period doubling A309873. ; ; Name this file a309873.l and run from the command line ; ; xfractint type=lsystem lfile=a309873.l lname=A309873angle120 params=12 ; ; Or interactively, the usual key "t", choose type lsystem, "F6" files, ; "F6" again the current directory, choose a309873.l, etc. Must name ; the file just foo.l not foo.l.txt for it to appear in the file chooser. ; ; "lname" is one of the angle variations below. Interactively, "t" ; and choose type lsystem (again) goes to the available L-systems in ; the current file. ; ; "params=12" is the expansion level (order), giving 2^12 segments. ; Interactively, key "z" changes that alone. ; The string built is ; ; F X + F Y - F X + F X + F X + F Y - F X + F Y - ... ; a(n) = +1 -1 +1 +1 +1 -1 +1 -1 ; n = 1 2 3 4 5 6 7 8 ; ; X is a point n >= 1 where n has an even number of low 0-bits. ; Y is a point n >= 1 where n has an odd number of low 0-bits. ; X and Y are followed by their respective turn + or - which is a(n). ; ; The expansion rules are each point n -> 2n-1, 2n. ; 2n-1 is odd so always X+ ; 2n is even so an extra low 0 which is flip X->Y or Y->X. ; For the flip, the doubled -- in X undoes the effect of the + which ; had followed the X and now should be - after Y. Conversely the ; doubled ++ in Y undoes its following -. ; ; These expansions are the A096268 morphism 0 -> 01, 1 -> 00 (or ; corresponding complement in A035263). The symbols here are simply ; X=0 and Y=1, except that Fractint is of the "one drawing symbol" ; type so an F precedes each X or Y. If there was a final stage ; expand of X->X+ and Y->Y- then the rule could be exactly the A096268 ; morphism. But L-systems are usually conceived with lines and turns ; spun out progressively rather than at the end. ; ; "Angle n" is turns by 360/n degrees in the usual Fractint way. A309873angle120 { ; Fido, turns by 120 degrees Angle 3 Axiom FX X = X+FY-- Y = X+FX++ } A309873angle60 { ; Fido variant, turns by 60 degrees Angle 6 Axiom FX X = X+FY-- Y = X+FX++ } A309873angle90 { ; turns 90 degrees, merely 4 unit squares Angle 4 Axiom FX X = X+FY-- Y = X+FX++ } A309873angle45 { ; turns 45 degrees, triangular Angle 8 Axiom FX X = X+FY-- Y = X+FX++ } ; ; "angle n" must be an integer n divisor of 360. ; To get 135 degrees, use 45 degrees (gcd(135,360)=45) and 3x copies of +/-. ; A309873angle135 { ; turns 135 degrees, similar to 45 degrees Angle 8 Axiom FX X = X+++FY------ Y = X+++FX++++++ } A309873angle30 { ; turns 30 degrees, 6 lobes Angle 12 Axiom FX X = X+FY-- Y = X+FX++ } ; ; "angle n" must be an integer n divisor of 360. ; To get 150 degrees, use 30 degrees (gcd(150,360)=30) and 5x copies of +/-. ; A309873angle150 { ; turns 150 degrees, similar to 30 degrees Angle 12 Axiom FX X = X+++++FY---------- Y = X+++++FX++++++++++ } ; Turns by 60 left and 120 right are the Koch curve. ; Benoit Cloitre draws some of this in A096268 file a096268.png ; The opposite way around, 120 left and 60 right, is a variant giving ; little triangles. ; The rules here are 60 degree angles and duplicate to make 120. ; The "undoing" of the unwanted turn described above is duplicated ; accordingly too. ; See the Xfractint supplied fractint.l for its own several Koch forms ; done in different ways. ; A309873Koch { ; Koch, turns 60 degrees left or 120 degrees right Angle 6 Axiom FX X = X+FY--- Y = X+FX+++ } A309873Koch2 { ; Koch variant, 120 degrees left or 60 degrees right Angle 6 Axiom FX X = X++FY--- Y = X++FX+++ } ; Local variables: ; compile-command: "xfractint type=lsystem lfile=a309873.l lname=A309873angle120 params=12" ; End: