Fractals and L- Systems

Similar documents
Midterm Project: L-systems in Practice and Theory

Computer Science 173 Fall, Project 3: Lindenmayer Systems Due in class on Monday, September 28

Developmental Systems

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2012 Lecture 28 November 8, 2012

Clouds, biological growth, and coastlines are

Fun with Fractals Saturday Morning Math Group

L-Systems and Affine Transformations

CSE 167: Lecture #15: Procedural Modeling. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSC 470 Computer Graphics. Fractals

12.2 Plants. CS Dept, UK

CHAPTER-3 STUDY OF GRAMMAR TREE USING L-SYSTEM. The central concept of L-systems is that of rewriting. In general, rewriting is a

Imaginary Gardens A Model for Imitating Plant Growth

Journal of Applied Mathematics and Computation (JAMC), 2018, 2(1), 13-20

L-Systems. Simulation of development and growth

More modelling. Ruth Aylett

Copyright 2009 Pearson Education, Inc. Chapter 9 Section 7 - Slide 1 AND

Topics. Recursive tree models. Procedural approach L-systems. Image-based approach. Billboarding

Koch-Like Fractal Images

CSE 167: Lecture #17: Procedural Modeling. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Novel Approach of Modeling Self Similar Objects using Parallel String Rewriting Methods through Combined L-System Techniques

1/16. Emergence in Artificial Life. Sebastian Marius Kirsch Back Close

Mathematics 350 Section 6.3 Introduction to Fractals

Procedural modeling and shadow mapping. Computer Graphics CSE 167 Lecture 15

biologically-inspired computing lecture 7 Informatics luis rocha 2015 biologically Inspired computing INDIANA UNIVERSITY

Fractals. Fractals. Beautiful designs of infinite structure and complexity Qualities of Fractals:

Fractals & Iterative Function Systems

Parametric L-Systems and borderline fractals

Koch Snowflake Go Figure The Koch Snowflake is a fractal based on a very simple rule.

<The von Koch Snowflake Investigation> properties of fractals is self-similarity. It means that we can magnify them many times and after every

Fractals: Self-Similarity and Fractal Dimension Math 198, Spring 2013

Generate Leaf Shapes using L-system and Genetic Algorithms

8 Special Models for Animation. Chapter 8. Special Models for Animation. Department of Computer Science and Engineering 8-1

Do not write in this area. Style (10) TOTAL. Maximum possible points: 30

CSE 167: Introduction to Computer Graphics Lecture #16: Procedural Modeling

Fractals and Multi-Layer Coloring Algorithms

Applications. 44 Stretching and Shrinking

11. Recursion. n (n 1)!, otherwise. Mathematical Recursion. Recursion in Java: Infinite Recursion. 1, if n 1. n! =

12. Recursion. n (n 1)!, otherwise. Educational Objectives. Mathematical Recursion. Recursion in Java: 1, if n 1. n! =

Exploring the Effect of Direction on Vector-Based Fractals

In this lesson, students build fractals and track the growth of fractal measurements using tables and equations. Enduring Understanding

Universiteit Leiden Computer Science

Turtle Graphics and L-systems Informatics 1 Functional Programming: Tutorial 7

Lecture 10: Lindenmayer Systems

Modeling Leaf Shapes Using L-systems and Genetic Algorithms

Lindenmayer systems, fractals, and their mathematics

Animating Plant Growth in L-System By Parametric Functional Symbols

Exploring Fractals through Geometry and Algebra. Kelly Deckelman Ben Eggleston Laura Mckenzie Patricia Parker-Davis Deanna Voss

Section 7.5. Fractals

The Koch curve in three dimensions

Fun with Fractals and Functions. CHAMP at University of Houston March 2, 2015 Houston, Texas

Fractal Trees. Gandhi Games

Fractals, Fibonacci numbers in Nature 17 mai 2015

A New Vision of Fractal Geometry with Triangulation Algorithm

Grade 6 Math Circles October 16 & Non-Euclidean Geometry and the Globe

Demonstrating Lorenz Wealth Distribution and Increasing Gini Coefficient with the Iterating (Koch Snowflake) Fractal Attractor.

Lecture 3: Some Strange Properties of Fractal Curves

lecture 9 Object hierarchies - call trees and GL_MODELVIEW stack - fractals - L systems

Fractals. Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna.

Genetic L-System Programming: Breeding and Evolving Artificial Flowers with Mathematica

Demonstrating Lorenz Wealth Distribution and Increasing Gini Coefficient with the Iterating (Koch Snowflake) Fractal Attractor.

Demonstrating Lorenz Wealth Distribution and Increasing Gini Coefficient with the Iterating (Koch Snowflake) Fractal Attractor.

Fractal Dimension and the Cantor Set

Implementing Lindenmayer Systems Simon Scorer BSc Computer Science & Mathematics (International) 2004/2005

Fractals. Materials. Pencil Paper Grid made of triangles

Logic, Algorithms and Data Structures Recursion and Stacks. By: Jonas Öberg

Section 9.5. Tessellations. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Images of some fractals

Lectures on Challenging Mathematics. Integrated Mathematics 3. Idea Math. Algebra (part 2) Summer Internal Use

Closed shapes with straight sides

Programming Training kiddo. Main Points: - Python Statements - Problems with selections.

Iterated Functions Systems and Fractal Coding

Grade 6 Math Circles. Shapeshifting

Some geometries to describe nature

Fractal Geometry. LIACS Natural Computing Group Leiden University

An Introduction to Fractals

Fractal Geometry. Prof. Thomas Bäck Fractal Geometry 1. Natural Computing Group

Computer Graphics (CS 543) Lecture 2c: Fractals. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Fractal Antennas. Dr. Ely Levine

Discrete Dynamical Systems: A Pathway for Students to Become Enchanted with Mathematics

MITOCW 2. IV: Consistency, Completeness, and Geometry

Computer Graphics 4731 Lecture 5: Fractals. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Symmetric Fractals. Seeking Sangaku Ramanujan, Hardy, and Ono

Discovering. Algebra. An Investigative Approach. Condensed Lessons for Make-up Work

CS108L Computer Science for All Module 8: Recursion and the Fractal Tree

a function that calls itself It doesn t do anything! Defining a recursive function 1) divide and conquer 2) base case 6/21/2018 chapter 15

Chapter 5. Models of plant organs. 5.1 Predefined surfaces

Grade 6 Math Circles October 16 & Non-Euclidean Geometry and the Globe

Scientific Calculation and Visualization

Fractal Analysis. By: Mahnaz EtehadTavakol

Gentle Introduction to Fractals

Chapel Hill Math Circle: Symmetry and Fractals

Fractal Image Compression

MAADHYAM. Nurturing Gifted Minds. Printed Under Gifted Education Abhiyaan An Initiative By The Office Of Principal Scientific Advisor To The

TREE FAÇADES. Generative Modelling with an Axial Branch Rewriting System

University of Virginia, Department of Computer Science cs150: Computer Science Spring 2007 Out: 5 February 2007 Problem Set 3: L-System Fractals

A TECHNOLOGY-ENHANCED FRACTAL/CHAOS COURSE. Taeil Yi University of Texas at Brownsville 80 Fort Brown Brownsville, TX

Before submitting the file project4.py, check carefully that the header above is correctly completed:

Fractals. University. 1 The approach and terminology used here are from Michael Frame s Fractal course taught for many years at Yale

Keywords: fractals, Lorenz curve, Gini Coefficient, wealth distribution

Draw beautiful and intricate patterns with Python Turtle, while learning how to code with Python.

Transcription:

Fractals and L- Systems Sanyam Gupta January 26, 2018 1 Lindenmayer systems Have you ever wondered, how to formulate a mathematical equation for the plant in your verandah or garden? The nature produces amazingly complex systems from simple starting points. Aristid Lindenmayer, a Hungarian theoretical biologist and botanist at the University of Utrecht. He developed the axiomatic thinking for the development of the biological systems. Lindenmayer systems (or L-systems) are the mathematical formalism for this axiomatic thinking, provided by Aristid Lindenmayer. In L-systems, complex structure develop through string rewriting. A string of letters is transformed into a new string of letters using simple rules called productions. The process of string transformation is repeated indefinitely. 1.1 Rewriting systems L-systems repeatedly rewrite a string. In general, rewriting is a technique for defining complex objects by successively replacing parts of a simple initial object (aka Axiom) using a set of rewriting rules or productions. The classic example of a graphical object defined in terms of rewriting rules is the snowflake curve, proposed in 1905 by von Koch. Mandelbrot restates this construction as follows: One begin with two shapes, an axiom and a generator (productions). The latter is an oriented broken line made up of N equal sides of length r. Thus each stage of the construction begins with a broken line and consists in replacing each straight interval with a copy of the generator, reduced and displayed so as to have the same end points as those of the interval being replaced. Illustration: F = move forward by a certain distance, = turn right by a certain angle δ, + = turn left by a certain angle δ. 1

Let, axiom= F ++F ++F, this corresponds to a equilateral triangle if δ = 60 (figure 2 for n = 0), and let, generator = F F + +F F, this corresponds to figure 1. So, whenever you see F in the axiom you replace it with the generator, and the resultant would be our new axiom. Therefore, old axiom becomes:(f F + +F F ) + +(F F + +F F ) + +(F F + +F F ) and this is our new Gen- Figure 1: erator axiom. We say, our first iteration has happened. This new axiom corresponds to figure 2 when iteration (n = 1). Further if we iterate this new axiom one more time i.e. n = 2 then we will get a rather clumsy axiom and a good approximation to the Koch Snow flake, for n = 3 this good approximation becomes a close approximation to the Koch Snow flake. Similarly if we iterate it infinitely many times (practically impossible, theoretically possible) then we can construct pure Koch Snow flake. Figure 2: Koch Snow flake 1.2 Turtle interpretation of strings The basic idea of turtle interpretation is very simple. A state of turtle is defined as a triplet (x, y, α), where Cartesian coordinates (x, y) represent the turtles position, and the angle α, called heading, is interpreted as the direction in which the turtle is facing. Given the step size d and the angle increment δ, the turtle can respond to the commands represented by the following symbols F, f, +,. Provided the value of d and δ. F : Move forward a step of length d in the direction of the heading. 2

f: Move forward a step of length d in the direction of the heading, without drawing a line. +: Turn left by an angle δ. : Turn right by an angle δ. For example, figure 3 presents approximation of Quadratic Koch Island as given in Mandelbrot s book. This figure was obtained by interpreting strings generated by the following L-system: Axiom:F F F F Production (generator):f F F + F + F F F F + F This image corresponds to the strings obtained in derivations of length d = 2(i.e. two pixels) and δ = 90. This example reveals a close relationship between constructions and L systems. Below are some examples along with the axiom, productions, number of iterations (n) and δ. Go and check those example on the online 1 Python Program. Quadratic Koch Island Axiom: F F F F, Generator: F F +F F F F F F +F +F F F F +F +F F +F F F, n = 2, δ = 90 Figure 3: Quadratic Koch Island Quadratic modification of the snowflake curve Axiom: F, Generator: F F +F F F +F, n = 4, δ = 90 Rings F F F F F + F, n = 4, δ = 90 Box F F F F F, n = 4, δ = 90 Koch Carpet F + F F F F, n = 3, δ = 90 1 https://trinket.io/python/8fe1caf5bd?outputonly=true&runoption=run 3

1.3 Branching structures and Bracketed L-systems According to rules presented so far, turtle interprets a character string as a sequence of line segments. However the plant kingdom is dominated by branching structures; thus a mathematical description of tree- like shapes and the methods for generating them are needed for modeling purposes. Two new symbols are introduced to delimit a branch. They are interpreted by the turtle as follows: [ : Push the current state of the turtle onto a pushdown stack. The information saved on the stack contains the turtles position and orientation, and possibly other attributes such as the color and width of lines being drawn. ] : Pop a state from the stack and make it the current state of the turtle. No line is drawn, although in general the position of the turtle changes. As an example of Bracketed L- systems and its turtle interpretation, obtained in the derivation of n = 3 and length d = 3. This figure was obtained by the interpretation of strings of the following L-systems. Axiom : F, Generator: F F [ F F ] + [F F F ] F F [ F F ] and δ = 20. Some more examples: 1. n = 4,δ = 25.7,Axiom: F, Generator: F F [+F ]F [ F ]F 2. n = 4,δ = 20,Axiom: F, Generator: F F [+F ]F [ F ][F ] Figure 4: Plant like structure 3. n = 4,δ = 22.5,Axiom: F, Generator: F F F [ F + F + F ] + [+F F F ] 2 Evolving Plants As you have seen in the previous examples, the tree thus far evolved only included one variable (i.e.f) terminal symbol. But the nature is more complex than these given examples, for this many more variable terminal symbols are introduced further, doing the same task that (F ) is doing. Introduction of more variables increases the size of the search space since there are a greater number of potential L-systems that can be produced from this type of grammar. Here only one new variable terminal symbol is introduced for illustrating that we can achive more complex 4 Figure 5: More complex Plant

systems by introducing more variable terminal symblols. Let s look at an example figure 5. Variables:XF,n = 5,δ = 30,Axiom: X, Generator(F ): F F F, Generator(X): X F [+X][ X]F X Some TIY 1 examples: Variables:XF,n = 5,δ = 22.5,Axiom: X, Generator(F ): F F F, Generator(X): X F [[X] + X] + F [+F X] X Variables:F,n = 6,δ = 30,Axiom: F, Generator(F ): F F [ F ][F ][+F ] 3 Fractals and L-systems Fractal curves can be represented by L-systems, as we have seen previous examples of Koch Curves. They are all fractals and are represented by the L-system grammar. Let s see an example of Sierpinski triangle: Variables:XF,n = 5,δ = 120,Axiom: F, Generator(F ): F X F X, Generator(X): X F + X + F (TIY). Another example: Variables:F,n = 5,δ = 45,Axiom: F + +F + +F + +F, Generator(F ): F F + F F + + + F + +F F F + + + F + +F F (TIY). Variables:F,n = 4,δ = 90,Axiom: F + F + F + F, Generator(F ): F F + F F F F F + F (TIY). Since, due to the machine restrictions the above examples cannot be iterated infinitely many times, if these examples are iterated infinitely many times then they will give rise to the Fractals i.e. self similar patterns, because fractals are the limiting case when n. But these examples give an beautiful algorithm to create fractals.there are many more patterns, you can create your own pattern, and try it on the above given Python program. 1 Try it yourself on Python Program at https://trinket.io/python/8fe1caf5bd? outputonly=true&runoption=run 5