블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

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
  • total
  • today
  • yesterday

Category

2007. 8. 26. 15:19 Code/NodeBox
막상 해 보지 않아서 찜찜했었는데, 이걸 이제야 해 보네.

from math import sin, radians, pi

size(320,240)
speed(100)

def setup():
    global x
    global y
    global p ##period
    global a ##amplitude
    global t ##time
   
    p = 100
    a = HEIGHT/4
    t = 0



def draw():
    global x
    global y
    global p
    global a
    global t
   
    t += 1
    x = t
    w = 2*pi*t/p
    y = a*sin(w) + HEIGHT/2
   
    if x >= WIDTH:
        t = 0
   
    oval(x,y,10,10)

'Code > NodeBox' 카테고리의 다른 글

David Hirmes - lines15  (0) 2007.08.01
David Hirmes - lines14  (0) 2007.07.31
David Hirmes - lines02  (0) 2007.07.25
David Hirmes - blobs01  (0) 2007.07.18
splash_class_multi  (0) 2007.07.13
posted by maetel