Fractals

From GenerativeArt

(Difference between revisions)
Jump to: navigation, search
       '''end'''
       '''end'''
-
=====Recursive Koch Curve=====
+
=====Recursive Koch curve=====
koch curve image here
koch curve image here
   //  Given:
   //  Given:
           KOCH(tx4, ty4, tx5, ty5, res)
           KOCH(tx4, ty4, tx5, ty5, res)
       '''endif'''
       '''endif'''
 +
  <br>
   image of koch line calculation here
   image of koch line calculation here
 +
 +
=====Stochastic fractal river=====
 +
Both fractals and L-systems can have stochastic (random/chance) forms.
 +
  '''function''' RIVERBEND(x1, y1, x2, y2, res)
 +
      '''if''' DIST(x1, y1, x2, y2) > res
 +
          // pick a random point on the line
 +
          // offset it by a random amount
 +
          // that new point is (x3, y3)
 +
          RIVERBEND(x1, y1, x3, y3)
 +
          RIVERBEND(x3, y3, x2, y2)
 +
      '''else'''
 +
          DRAW(x1, y1, x2, y2)
 +
      '''endif'''
 +
  <br>
 +
  riverbend image goes here

Revision as of 19:43, 10 November 2008

Personal tools