Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # turtle_makingwaves.py
- from turtle import*
- from math import*
- screen = Screen()
- speed(0)
- def waveform(wlen, amp, iter, xcor, ycor, phase):
- for i in range(400):
- y= amp*sin(iter+phase)
- x= wlen*iter/(2*pi)
- goto(x+xcor,y+ycor)
- iter+=0.1
- setup(width = 500, height = 500, startx =200, starty =200)
- bgcolor('lightblue')
- pensize(3)
- pencolor('blue')
- up()
- xc=-300
- yc=-210
- goto(xc,yc)
- down()
- for z in range(18):
- waveform(100,10,0.1,xc,yc,pi/2)
- up()
- yc+=30
- goto(xc,yc)
- down()
- ht()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement