Fractals
From GenerativeArt
(Difference between revisions)
(→Fractal or Box Counting dimension: Added content) |
Current revision (22:33, 16 September 2013) (view source) (→Fractal or Box Counting Dimension) |
||
=====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 | ||
- | + | BEND(x1, y1, x2, y2) | |
- | + | ||
- | + | ||
RIVERBEND(x1, y1, x3, y3) | RIVERBEND(x1, y1, x3, y3) | ||
RIVERBEND(x3, y3, x2, y2) | RIVERBEND(x3, y3, x2, y2) | ||
{{SingleImage|imageWidthPlusTen=510|imageURL=http://www.viz.tamu.edu/courses/viza626/10Fall/fractImg3.gif|caption=Note that a line segment has a fractal dimension of 1}}<br /> | {{SingleImage|imageWidthPlusTen=510|imageURL=http://www.viz.tamu.edu/courses/viza626/10Fall/fractImg3.gif|caption=Note that a line segment has a fractal dimension of 1}}<br /> | ||
{{SingleImage|imageWidthPlusTen=510|imageURL=http://www.viz.tamu.edu/courses/viza626/10Fall/fractImg4.gif|caption=Note that a square has a fractal dimension of 2}}<br /> | {{SingleImage|imageWidthPlusTen=510|imageURL=http://www.viz.tamu.edu/courses/viza626/10Fall/fractImg4.gif|caption=Note that a square has a fractal dimension of 2}}<br /> | ||
- | {{SingleImage|imageWidthPlusTen= | + | {{SingleImage|imageWidthPlusTen=600|imageURL=http://philipgalanter.com/generative_art/graphics/sierp-det.GIF|caption=The Sierpinski triangle is constructed yielding 3 copies at 1/2 size so the fractal dimension = log(3)/log(2) = 1.58}}<br />{{SingleImage|imageWidthPlusTen=1000|imageURL=http://philipgalanter.com/generative_art/graphics/box_counting_dimension.png|caption=Here is an illustration of the box counting method to measure the fractal dimension of actual objects, in this case the coastline of England}}<br /> |