introduction to fractals length of the fractals€¦ · introduction to fractals •term fractal...
Post on 21-Jun-2020
36 Views
Preview:
TRANSCRIPT
1
1
CS 430/536Computer Graphics I
FractalsWeek 10, Lecture 19
David Breen, William Regli and Maxim PeysakhovGeometric and Intelligent Computing Laboratory
Department of Computer ScienceDrexel University
http://gicl.cs.drexel.edu
2
Overview
• Fractal representations• Algorithms for drawing fractals• Mandelbrot Set• Brownian Motion
1994 Foley/VanDam/Finer/Huges/Phillips ICG
3
Introduction to Fractals• Term Fractal coined by Benoit Mandelbrot• Properties of fractal:
– Self-similarity (small portion looks like the whole object )– Have fractional dimensions– Non-differentiable– Infinite length
Construction of Koch Curve
Compiled from Gary W. Flake “The Computational Beauty of Nature”
4
Length of the Fractals
• Lewis Richardson(1961) measuredlength of coastlines
• Total length increaseas measurementstick reduced
• Does this meancoastlines are infinitein length?
Compiled from Gary W. Flake “The Computational Beauty of Nature”
5
Koch Curve
http://www.arcytech.org/java/fractals/
6
• Has no tangent at any point• Length of the curve at iteration n is (4/3)n
• Koch curve is 1.26186 …dimensional object
Properties of Koch Curve
Compiled from Gary W. Flake “The Computational Beauty of Nature”
1.77777780.11111111621.33333330.333333341
3.11798*10121.94033*10-481.04858*1060100
1110Total lengthLength of segmentNum of segmentsStep
2
7
Fractal Dimensions• 1D line of unit length divided into n segments
looks like the whole line scaled by 1/n• 2D square of unit area divided into n segments
looks like the whole square scaled by 1/n1/2– i.e. 4 segments, each one 1/2 the size of the original
• Divide an object into n segments where eachsegment is scaled by 1/s
• s = n1/d d = log(n)/log(s) 2 = log(4)/log(2)• The square is divided into 4 parts and each part is
1/2 the size of the original• d = log(4)/log(2) = 2
8
Fractal Dimensions• s = n1/d d = log(n)/log(s)• Koch curve divides line into 4 parts, each part is
1/3 the size of the original• Therefore the dimension of the Koch curve is:
!
41d = 3, n1/ d
= s
d =log(4)
log(3)=
log(n)
log(s)=1.26186 ...
9
Space Filling Fractals• Peano curve (1890)• Fills a 2D region• Fractal dimension - 2• s = n1/d 9 segments 1/3 original size
2 = log(9)/log(3)
Construction of Peano Curve
Compiled from Gary W. Flake “The Computational Beauty of Nature”
10
Sierpinski Triangle
http://www.arcytech.org/java/fractals/
11
• Fractals often occur in nature• All natural fractals are grown• We can model natural objects with fractals
Naturally Occurring Fractals
Brain Lungs Kidney
Compiled from Gary W. Flake “The Computational Beauty of Nature”
13
Production Systems
• In 1968 A. Lindenmayer developeda formalism describing plant growth.
• Called L-system• L-system consists of:
– Seed cell (axiom)– Production rules
Axiom: B Rules: B=>F[-B][+B] F=>FF
Compiled from Gary W. Flake “The Computational Beauty of Nature”
3
14
PlantlikeFractals 1
Compiled from Gary W. Flake “The Computational Beauty of Nature”
15
PlantlikeFractals 2
Compiled from Gary W. Flake “The Computational Beauty of Nature”
16
PlantlikeFractals 3
Compiled from Gary W. Flake “The Computational Beauty of Nature”
17
• Fractal often described to contain miniatureversions of itself.
• We can use affine transformations to describewhere these miniatures should be placed– Translation– Rotation– Scaling
• Self-affine fractals may have different scalingfactors in different dimensions
Affine Transformation Fractals
Compiled from Gary W. Flake “The Computational Beauty of Nature”
18
• Can be simulated with real copy machine• Copy machine takes a seed image• Creates several transformed copies of it as an output.• Procedure is recursive
Multiple Reduction CopyMachine Algorithm
Compiled from Gary W. Flake “The Computational Beauty of Nature”
19
MRCM Examples
Compiled from Gary W. Flake “The Computational Beauty of Nature”
4
20
Problems with MRCM
• To get good image wemust compute MRCMto large depth
• Computing time growsexponentially with depth
• Problem amplified whenthe reduction in sizeduring one iteration issmall
Compiled from Gary W. Flake “The Computational Beauty of Nature”
Fern Leaf21
• Observations:– Fractal consist entirely of points– Randomly and recursively apply affine
transformation Li(p) to point p– Converges to a fractal
Iterated Functional System
Compiled from Gary W. Flake “The Computational Beauty of Nature”
500 points 5000 points
22
• Pick random point of the seed image• Randomly pick one of the affine
transformations• Transform the point• Continue recursively
IFS Algorithm
Fern LeafCompiled from Gary W. Flake “The Computational Beauty of Nature”
23
IFS Generated Tree
Compiled from Gary W. Flake “The Computational Beauty of Nature”
24
• xn=xn-12+c for some complex number c
– For some c, x→ 0 as n→ ∞c ∈ Mandelbrot Set
– For some c, x→∞ as n→ ∞– For others neither
Mandelbrot Set
For each c in the complex planex0=0
for (n=1 to nmax) {xn= xn
2+cif (|xn|>2) break
}If (n < nmax) color c = white
else color c = blackfrom http://www.astro.su.se/~alexis/fractals/
Mandelbrot Set
Magnified region
25
Mandelbrot Set
Compiled from Gary W. Flake “The Computational Beauty of Nature”
5
26
Mandelbrot Set
Recorded with XaoS
27
Newton Set f(x) = x3 - 1 xn+1 = xn - f(x) / f'(x)
Recorded with XaoS
28
Phoenix Setzn + 1 = zn
2 + Re(c) + Im(c) * zn - 1
Recorded with XaoS
29
• The dance of pollen grains in a water drop(Robert Brown in 1827)
• Explained by AlbertEinstein in 1905
• Self-similar motion• Infinite length• Used to simulate
rivers mountainsand other randomnatural phenomena
Brownian Motion
30
• Fractional BM (fBM) is a generalization of BM toinclude memory– Integral on progress of random walk
• fBM characterized by it’s power spectrum– BM has 1/f2 power spectrum– fBM had 1/fβ power spectrum
with 1.0 ≤ β ≤ 3.0• Think of β as controlling
terrain roughness
Fractional Brownian Motion
Voss & Saupe in “The Science of Fractal images”
31
• Landscape generated by the XMOUNTAINS programby Steven Booth
• Realistic, self-similar image
XMOUNTAINS
Compiled from Gary W. Flake “The Computational Beauty of Nature”
6
32
XMOUNTAINS: Changing Fractal Dimension
34
Random MidpointDisplacement
• fBM computations are time consuming• RMD are faster to compute but less realistic• Basic idea:
– Start with 2 (2D) 4 (3D)random points.
– Compute the midpoint foreach interval
– Displace the midpoint atrandom but based on thedifference between endpoints
Michael Shantz @ University of Waterloo
35
RMD Algorithm
x
y
y(b)
y(a)
a b
x
y
y(b)
y(a)
a b
ymid
a+b2
x
y a b
d c
x
y a b
d c
h f
e
g
m
• Generate points a and b at randomymid = (1/2)(y(a)+y(b))+rr = s·(|b-a|)·rg()s - is a surface roughness
parameterrg()- returns a Gaussian random value
(mean = 0, variance = 1)
In 3D version:ym = (1/4)(y(a)+y(b)+y(c)+y(d))+r
36
Controlling the Topography
• To model real environments we want tocontrol the placement of peaks and valleys
• We can do it by setting up Control Surfaces.• Calculate random elevations based on:
– Elevation of controlsurface
– Average elevation ofthe midpoint
37
Fractal MountainsKen Musgrave
38
Cellular Automata
• Invented by Johnvon Neumann in1940s
• Thoroughly studiedby Wolfram
• Mechanism to studyreproduction
• Dynamic system– Discrete in space– Discrete in time
Compiled from Gary W. Flake “The Computational Beauty of Nature”
7
39
Compiled from Gary W. Flake “The Computational Beauty of Nature”
Cellular Automata in Nature
• Process which creates seashells has beenlinked to a one-dimensional CA
40
Conus Textile Seashell
Source: wikipedia.org
top related