Controls:

You can interact with the pendulums via left and right click drag, and pause with Space or Ctrl (still interactive)

Parameters:

You can set different parameters for the sim using the input box that *might* show up at the top of the page, if that's the case:

Exit all the input prompts to go with the defaults

Or

You can set each parameter in each dialogue box that shows up (input character for default) in this order: 

  1. Screen width
  2. Screen height
  3. A number for the accuracy of the simulation (positive, the smaller the more accurate, default is 0.001)
  4. Pendulum's thickness (1 or 2 pixels)
  5. Initial angle of first pendulum (rad)
  6. Initial angle of second pendulum (rad)
  7. Initial angular velocity of first pendulum (rad/s)
  8. Initial angular velocity of second pendulum (rad/s)
  9. Length of first pendulum (m)
  10. Length of second pendulum (m)
  11. Mass of first pendulum (kg)
  12. Mass of second pendulum (kg)
  13. Simulation speed (1 is real time)
  14. Air resistance (should be around 0.1)

Enjoy :D

Also I borrowed 😉 the formulas at the end of this page https://www.myphysicslab.com/pendulum/double-pendulum-en.html and just did a simple numerical approx by iterating on lil steps. Check em out they have cool stuff

Download

Download
CodeJam.exe 105 kB

Leave a comment

Log in with itch.io to leave a comment.