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:
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
- Python Implementation by Deborah R. Fowler
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 firstname.lastname@example.org. 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.