#mouse movement changes the locational property of the polygon #...genreating randomness
#program designed such that it could change the radial property
import math
g.paper(100)
g.pen(0)
def polygon(x, y, radius, sides):
for a in range (0,10):
theta = a*(math.pi*2/sides)
theta1 = (a-1)*(math.pi*2/sides)
#g.line(x+radius, y, int(x+radius*math.cos(theta)), int(y+radius*math.sin(theta)))
g.line(int(x+radius*math.cos(theta1)), int(y+radius*math.sin(theta1)), int(x+radius*math.cos(theta)), int(y+radius*math.sin(theta)))
while 1:
m1 = g.getMouse(1)
m2 = g.getMouse(2)
polygon((m1*5), (m2*5), 25, 10)
|