Introduction | Phyllotaxis
Phyllotaxis/phyllotaxy is the arrangement of leaves on a plant stem & the Phyllotactic spirals form a distinctive class of patterns in nature. The word itself comes from the Greek phullon, meaning “leaf, ” and taxis, meaning “arrangement”.The basic floral phyllotaxic arrangements include:
1. Spiral Phyllotaxis – In spiral phyllotaxy, the individual floral organs are created in a regular time interval with the same divergent angle. The divergent angle in a flower with spiral phyllotaxy approximates 137.5 degrees, which is indicative of a pattern that follows a Fibonacci series.The image below shows the spiral phyllotaxy patterns having both clockwise and anticlockwise spiral patterns.
Important points to note:
- Fibonacci series typically describe spirals found in nature. It is calculated as a series where the previous pair of numbers sum to the next number in the series. The series is 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 … .
- There is actually one set of spirals in a clockwise direction and one set in a counter-clockwise direction.
- Floral organ spirals follow a numerator and denominator set of offset Fibonacci numbers (1/2, 1/3, 2/5, 3/8, 5/13, 8/21, 13/34 …). The numerator is the number of times or turns around the axis to get back to the initiation origin. The denominator indicates the number of organs initiated during the turns. Therefore, a 2/5 would indicate 2 turns around the axis and 5 organs to return to the origin.
- e.g – In the pine we have (2, 3), (5, 3), and (5, 8) phyllotaxes, in capituli the pairs found are (21, 34), (55, 34), (55, 89), and (89, 144), and on pineapples with hexagonal scales the triplets (8, 13, 21) or (13, 21, 34) are found, depending on the size of the specimens .
- The prevalence of the Fibonacci sequence in phyllotaxis is often referred to as “the mystery of phyllotaxis.”
Other types of floral phyllotaxic arrangements are:
2. Whorled Phyllotaxis, 3. Simple-whorled Phyllotaxis, 4. Complex-whorled Phyllotaxis & 5. Irregular Phyllotaxis
Formation of the Pattern : Summary
The beautiful arrangement of leaves in some plants, called phyllotaxis, obeys a number of subtle mathematical relationships. For instance, the florets in the head of a sunflower form two oppositely directed spirals: 55 of them clockwise and 34 counterclockwise. Surprisingly,
- These numbers are consecutive Fibonacci numbers.
- The ratios of alternate Fibonacci numbers are given by the convergents to φ^(-2), where φ is the golden ratio, and are said to measure the fraction of a turn between successive leaves on the stalk of a plant:
- e.g : 1/2 for elm and linden, 1/3 for beech and hazel, 2/5 for oak and apple, 3/8 for poplar and rose, 5/13 for willow and almond, etc.
- Each new leaf on a plant stem is positioned at a certain angle to the previous one and that this angle is constant between leaves: usually about 137.5 degrees.
That is, if you look down from above on the plant and measure the angle formed between a line drawn from the stem to the leaf and a corresponding line for the next leaf, you will find that there is generally a fixed angle, called the divergence angle.
Here, we are interested in Spiral phyllotaxy and we will code to form Spiral Phyllotaxy pattern in python using turtle graphics.
Designing the Code
- We will code two functions, one to draw the phyllotaxy pattern and the other to draw the petals.
- The petals need to be drawn only after the phyllotaxis pattern is completed.So, we will call the drawPetal() function from inside the drawPhyllPattern() function with the last x & y coordinates being visited after drawing the Phyllotaxis pattern.
- The drawPetal() function will draw the petals with turtle functions and features, refer Turtle programming.
To code the phyllotaxis pattern, we need to follow these equations:
x = r*cos(θ) y = r*sin(θ) r, θ can also vary - so the to form phyllotactic pattern we substitutethe cartesian form by polar form: r = c*sqrt(n) θ = n*137.508°
Reduces the problem to optimal packing on a disc, so r = c*sqrt(n) is from the area of the circle Area = πr² and n fills the Area in some units c1 * n/π = r², c is 1/sqrt(c1/π) So, r = some constant c * sqrt(n)
PseudoCode : Phyllotaxis Pattern
IMPORT MODULES ( MATH, TURTLE ) FUNCTION - DrawPhyllotaxisPattern( turtle, t length, petalstart, angle = 137.508, size, cspread) turtleColor("Black") FillColor('"Orange") Convert angle to radians (Φ) initialize ( xcenter,ycenter ) = ( 0,0 ) Drawing the Pattern Starts: For n in Range ( 0,t ): r = cspread * sqrt(n) θ = n * Φ x = r * cos(θ) + xcenter y = r * sin(θ) + ycenter TURTLE POSITION(x,y) START DRAWING(): if Drawing pattern ends: DrawFlowerPetals() FUNCTION - DrawFlowerPetals(Turtle, x coordinate, y coordinate) DRAW using Turtle methods Create Turtle = gfg Call DrawPhyllotaxisPattern( gfg, t length, petalstart, angle = 137.508, size, cspread) END
Python Pattern A
Python Pattern B
Output: Phyllotaxis Patterns.
- Python and Turtle Graphics by Deborah R. Fowler
- Phyllotactic Pattern by Deborah R. Fowler
- Python Implementation by Deborah R. Fowler
- Phyllotaxis: The Fibonacci Sequence in Nature
- algorithmicbotany.org papers
This article is contributed by Amartya Ranjan Saikia. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Unit Testing in Python - Unittest
- Python | Unit Test Objects Patching | Set-2
- Python | Unit Test Objects Patching | Set-1
- Python | Exceptional Conditions Testing in Unit Tests
- Pattern matching in Python with Regex
- Python | Increment 1's in list based on pattern
- Python Program to print digit pattern
- Python | Increasing alternate element pattern in list
- Python | Get the smallest window in a string containing all characters of given pattern
- Python program to print checkerboard pattern of nxn using numpy
- fnmatch - Unix filename pattern matching in Python
- Python | Plotting an Excel chart with pattern fills in column using XlsxWriter module
- Gated Recurrent Unit Networks
- ML | Text Generation using Gated Recurrent Unit Networks
- Pattern Recognition | Introduction