This project simulates a double pendulum, using differential equations to model the system's angular momentum over time, and renders the motion in real time with raylib.
- Press
Spaceto start or pause the simulation. - While paused, click and drag either pendulum to set a new angle.
- Release the mouse, then press
Spaceagain to continue from the new position.
- Install Homebrew if needed.
- Install dependencies:
brew update
brew install raylib pkg-config- Update package lists.
- Install compiler, make, pkg-config, and raylib development files:
sudo apt update
sudo apt install -y build-essential clang pkg-config libraylib-dev- Install compiler, make, pkg-config, and raylib development files:
sudo dnf install -y gcc clang make pkgconf-pkg-config raylib-devel- Build and run:
make
make runIf raylib-devel is not available in your enabled repositories (common on some RHEL-based setups), enable EPEL/extra repos for your distribution or install raylib from source first.
The easiest path is WSL2 with Ubuntu.
- Open your Ubuntu (WSL2) terminal in the project folder.
- Install dependencies:
sudo apt update
sudo apt install -y build-essential clang pkg-config libraylib-devAlternative (native Windows): use MSYS2 UCRT64 and install equivalent packages for clang, make, pkg-config, and raylib.
After installing dependencies on your platform:
makemake runmake cleanSpecial thanks to Daniel Hirsch for sparking the idea for this project through his video on the same topic.
Though this project is strongly inspired by that work, no code has been copied
