from visual import * scene.autoscale = 0 # The parameter a in the logistic map - vary this to # see different behaviors. a = 2.5 # create two cones (assigned to conea and coneb) that point # "up" on the screen (positive y - by setting axis) # and have narrow bases, slightly separated in position, pointed # oppositely (base to base) conea = cone(radius=0.1, color=color.green, x=0.25, axis=(0,1,0)) coneb = cone(radius=0.1, color=color.red, x=0.26, axis=(0,-1,0)) # repeatedly apply reflection map, 3 times a second, until program # stopped. Pause for 5 seconds to allow user to zoom in. for i in range(20): rate(4) ## The while loop repeats the map on the two cones forever, ## 5 times a second. (It can help to increase rate.) while 1: rate(5) conea.x = a * conea.x * (1. - conea.x) coneb.x = a * coneb.x * (1. - coneb.x)