A visual representation and implementation of the double pendulum algorithm (https://en.wikipedia.org/wiki/Double_pendulum).
I was testing out various libraries for canvas drawings and wanted a short project to test out PyGame
- Display arm1 as line from pointA to pointB
- Display arm1 as line from pointB to pointC
- PointA is a fixed point
- Display pointB as a circle of size relative to its mass
- Display pointC as a circle of size relative to its mass
- Implement algorithm to calculate new positions each frame
- Optionally display a trail behind pointB
The main goal was to understand and implement the alorithm which was completed but there are numerous other extra features which could be implemented such as:
- Colour
- Additional arms
- Controls for variables (starting points, arm lengths, point masses, friction etc)
- Draggable points
- Colour
python3 main.py