Fractals

From GenerativeArt

(Difference between revisions)
Jump to: navigation, search
(Fractal or Box Counting dimension: Added content)
(Stochastic fractal river: improve pseudocode)
=====Stochastic fractal river=====
=====Stochastic fractal river=====
Both fractals and L-systems can have stochastic (random/chance) forms.
Both fractals and L-systems can have stochastic (random/chance) forms.
-
   '''function''' RIVERBEND(x1, y1, x2, y2, res)
+
   //  Given:
 +
  //  res                      :length of smallest line to be drawn
 +
  //  DIST(x1, y1, x2, y2)    :distance between points (x1, y1) and (x2, y2)
 +
  //  BEND(x1, y1, x2, y2)    :returns x3,y3 randomly between and offset
 +
  <br>
 +
'''function''' RIVERBEND(x1, y1, x2, y2, res)
       '''if''' DIST(x1, y1, x2, y2) > res
       '''if''' DIST(x1, y1, x2, y2) > res
-
           // pick a random point on the line
+
           BEND(x1, y1, x2, y2)
-
          // offset it by a random amount
+
-
          // that new point is (x3, y3)
+
           RIVERBEND(x1, y1, x3, y3)
           RIVERBEND(x1, y1, x3, y3)
           RIVERBEND(x3, y3, x2, y2)
           RIVERBEND(x3, y3, x2, y2)

Revision as of 22:16, 16 September 2013

Personal tools