Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Animate-a-pendulum/Logo/animate-a-pendulum.logo
Normal file
29
Task/Animate-a-pendulum/Logo/animate-a-pendulum.logo
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
make "angle 45
|
||||
make "L 1
|
||||
make "bob 10
|
||||
|
||||
to draw.pendulum
|
||||
clearscreen
|
||||
seth :angle+180 ; down on screen is 180
|
||||
forward :L*100-:bob
|
||||
penup
|
||||
forward :bob
|
||||
pendown
|
||||
arc 360 :bob
|
||||
end
|
||||
|
||||
make "G 9.80665
|
||||
make "dt 1/30
|
||||
make "acc 0
|
||||
make "vel 0
|
||||
|
||||
to step.pendulum
|
||||
make "acc -:G / :L * sin :angle
|
||||
make "vel :vel + :acc * :dt
|
||||
make "angle :angle + :vel * :dt
|
||||
wait :dt*60
|
||||
draw.pendulum
|
||||
end
|
||||
|
||||
hideturtle
|
||||
until [key?] [step.pendulum]
|
||||
Loading…
Add table
Add a link
Reference in a new issue