-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakhi2.py
57 lines (43 loc) · 935 Bytes
/
Rakhi2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import math
import turtle
tina = turtle.Turtle()
tina.shape("turtle")
tina.color("black")
tina.speed(0)
def pos(x,y):
tina.penup()
tina.goto(x,y)
tina.pendown()
tina.color("red")
tina.begin_fill()
pos(0,-250)
tina.circle(250)
tina.end_fill()
def draw(t, numseeds, angle, cspread):
t.fillcolor("orange")
phi = angle * (math.pi / 120.0)
for i in range (numseeds):
# figure out the next x, y position
r = cspread * math.sqrt(i)
theta = i * phi
x = r * math.cos(theta)
y = r * math.sin(theta)
# move the turtle and orient it correctly
t.penup()
t.goto(x, y)
t.setheading(i * angle)
if i < numseeds:
t.stamp()
draw(tina,500,18.7,9)
pos(250,0)
tina.pensize(15)
tina.pencolor("gold")
for i in range(40):
tina.left(5)
tina.forward(25)
pos(-250,0)
tina.pensize(15)
tina.pencolor("gold")
for i in range(40):
tina.left(5)
tina.forward(25)