फाइलोटैक्सिस पैटर्न क्या है?
जब हम वापस जाते हैं, तो हमारे वनस्पति विज्ञान वर्गों और पौधों की दुनिया में, फ़ाइलोटैक्सिस का अर्थ है पौधों के तने पर फूलों, पत्तियों या बीजों की व्यवस्था, जैसा कि फाइबोनैचि सर्पिल में पाया जाता है। फाइबोनैचि अनुक्रम के आधार पर, फाइबोनैचि सर्पिल संख्याओं का एक समूह है जो पास्कल के त्रिकोण पर समान पैटर्न का अनुसरण करता है। फाइबोनैचि अनुक्रम संख्या कुछ इस तरह है - 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, आदि। तो फाइबोनैचि अनुक्रम संख्या इसकी पिछली संख्याओं का योग है।
फाइबोनैचि सर्पिल
हम आम तौर पर अपने आस-पास की वस्तुओं को समझने के लिए समरूपता और पैटर्न की तलाश करते हैं। इसे महसूस किए बिना हमारी आंखें फिबोनाची अनुक्रमों को देख रही हैं, या सूरजमुखी के सिर के मामले में, एक फाइबोनैचि सर्पिल।
समाधान


सूरजमुखी सर्पिल
उदाहरण कोड
import math
import turtle
def PhyllotacticPattern( t, petalstart, angle = 137.508, size = 2, cspread = 4 ):
"""print a pattern of circles using spiral phyllotactic data"""
# initialize position
turtle.pen(outline=1,pencolor="black",fillcolor="orange")
# turtle.color("orange")
phi = angle * ( math.pi / 180.0 )
xcenter = 0.0
ycenter = 0.0
# for loops iterate in this case from the first value until < 4, so
for n in range (0,t):
r = cspread * math.sqrt(n)
theta = n * phi
x = r * math.cos(theta) + xcenter
y = r * math.sin(theta) + ycenter
# move the turtle to that position and draw
turtle.up()
turtle.setpos(x,y)
turtle.down()
# orient the turtle correctly
turtle.setheading(n * angle)
if n > petalstart-1:
#turtle.color("yellow")
drawPetal(x,y)
else: turtle.stamp()
def drawPetal( x, y ):
turtle.up()
turtle.setpos(x,y)
turtle.down()
turtle.begin_fill()
#turtle.fill(True)
turtle.pen(outline=1,pencolor="black",fillcolor="yellow")
turtle.right(25)
turtle.forward(100)
turtle.left(45)
turtle.forward(100)
turtle.left(140)
turtle.forward(100)
turtle.left(45)
turtle.forward(100)
turtle.up()
turtle.end_fill() # this is needed to complete the last petal
turtle.shape("turtle")
turtle.speed(0) # make the turtle go as fast as possible
PhyllotacticPattern( 200, 160, 137.508, 4, 10 )
turtle.exitonclick() # lets you x out of the window when outside of idle समाधान

आपके उपरोक्त कार्यक्रम में एक छोटे से बदलाव के साथ, आप परिणाम को कुछ इस तरह से विस्थापित कर सकते हैं (कस्टम रंग दें और कुछ मान बदलें):
