gitwtfhub

wtf is pendulum?

rougier/pendulum — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2018-09-03

20PythonAudience · generalComplexity · 2/5DormantSetup · easy

TL;DR

A Python program that simulates and animates a chaotic double pendulum in real time using matplotlib, showing how simple physics rules create unpredictable motion.

Mindmap

mindmap
  root((repo))
    What it does
      Simulate physics
      Animate in real time
      Show chaotic motion
      Draw with matplotlib
    Tech stack
      Python
      Matplotlib
    Use cases
      Teach chaos theory
      Learn animation
      Study physics simulation
    Audience
      Physics students
      Python learners
    Content
      Frame by frame animation
      No configurable UI
    Notes
      Minimal readme
      Edit code to customize

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Watch a double pendulum simulation to visually understand how chaotic systems behave.

REASON 2

Use as a teaching aid for physics students learning about chaos theory and sensitivity to initial conditions.

REASON 3

Study the code as a starting example for building animated physics visualizations with matplotlib.

What's in the stack?

PythonMatplotlib

How it stacks up

rougier/pendulumalex72-py/aria-termuxanime0t4ku/gentleman
Stars202020
LanguagePythonPythonPython
Last pushed2018-09-03
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/52/5
Audiencegeneraldevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

README doesn't document customization, check the source code to adjust pendulum length, weight, or starting angle.

Wtf does this do

This is a Python program that simulates and visualizes a double pendulum, that's a pendulum with another pendulum attached to its end, and animates it in real time so you can watch it swing around. A double pendulum is a classic physics system that looks simple but behaves in surprisingly complex ways. Unlike a regular pendulum that swings back and forth predictably, a double pendulum can swing chaotically, with the second weight moving in wild, unpredictable arcs depending on tiny changes in starting position. The program calculates the physics of how each part moves, then uses matplotlib (a Python plotting library) to draw and animate the motion frame by frame, creating a smooth visualization you can watch on your screen. This kind of project is useful for a few reasons. Physics students and teachers use it to understand how chaotic systems work, it's a great visual proof that simple rules can create complex behavior. People interested in animation or data visualization might use it as a starting point for learning how to create animated graphics in Python. It's also just satisfying to watch something that looks physically realistic move around on screen. If you're learning physics simulations or matplotlib, this gives you a concrete working example to study and build on. The README doesn't provide much additional detail about how to run it or customize it, so you'd likely need to check the actual code files to learn how to adjust things like the pendulum length, weight, or starting angle.

Yoink these prompts

Prompt 1
Explain how this double pendulum simulation calculates the physics of each swinging arm.
Prompt 2
Show me how to change the pendulum's starting angle and weight in this code.
Prompt 3
Help me extend this matplotlib animation to plot the pendulum's chaotic trajectory over time.
Prompt 4
Walk me through how matplotlib's animation function is used here to redraw each frame.

Frequently asked questions

wtf is pendulum?

A Python program that simulates and animates a chaotic double pendulum in real time using matplotlib, showing how simple physics rules create unpredictable motion.

What language is pendulum written in?

Mainly Python. The stack also includes Python, Matplotlib.

Is pendulum actively maintained?

Dormant — no commits in 2+ years (last push 2018-09-03).

How hard is pendulum to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is pendulum for?

Mainly general.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.