
One good way of making an animation is by simulating a physical system and illustrating the variables in that system using a dynamically changing graphical display.

The classic such physical system is a simple gravity pendulum.



Task

Create a simple physical model of a pendulum and animate it.




on animate
  clear
  move 50 50
  circle 1
  x = 50 + 40 * sin ang
  y = 50 - 40 * cos ang
  line x y
  circle 5
  vel += sin ang / 5
  ang += vel
.
ang = 45