From: Poul R. <Pou...@sk...> - 2012-10-14 14:22:10
|
This iss excellent - thank you! Best regards, Poul Riis Bru...@nc... writes: >from __future__ import division, print_function >from visual import * >scene.title = 'Spiral' >scene.width = scene.height = 800 >scene.background = color.white >scene.foreground = color.black >scale = 1 >xaxis = curve(pos=[(-scale,0),(scale,0)], color=color.gray(.5)) >yaxis = curve(pos=[(0,-scale),(0,scale)], color=color.gray(.5)) >xlabel = label(pos=(0.95*scale,-0.05*scale), text='x', box=0) >ylabel = label(pos=(0.05*scale,0.95*scale), text='y', box=0) > >p = points(color=color.blue) >kr = 1 >kt = 1 >t = 0 >dt = pi/360 >while True: >rate(1000) >r = kr*t >theta = kt*t >x = r*cos(theta) >y = r*sin(theta) >t += dt >m = max([x,y]) >if m > scale: >scale = 1.05*m >xlabel.pos = (0.95*scale,-0.05*scale) >ylabel.pos = (0.05*scale,0.95*scale) >xaxis.pos = [(-scale,0),(scale,0)] >yaxis.pos = [(0,-scale),(0,scale)] >p.append(pos=(x,y)) |