Codementor Events

How and why I built Interactive Double Pendulum Playground

Published Nov 07, 2021
How and why I built Interactive Double Pendulum Playground

About me

I am a pseudo-introvert, a web developer, and a Maker.

https://theabbie.github.io

The problem I wanted to solve

I wanted to make a double pendulum simulation where people can play with it by fiddling with various parameters.

What is Interactive Double Pendulum Playground?

Double pendulum is a pendulum with another pendulum attached to its end, is a simple physical system that exhibits rich dynamic behavior with a strong sensitivity to initial conditions.

The motion of a double pendulum is governed by a set of coupled ordinary differential equations and is chaotic.

Tech stack

HTML, CSS, JavaScript and SVG

The process of building Interactive Double Pendulum Playground

I used SVG to draw the pendulum on webpage and wrote the logic in JavaScript.

Challenges I faced

Finding the best equation of motion for double pendulum which would work smoothly and also be accurate enough. Also, finding a method to efficiently smoothen the pendulum trace.

Key learnings

Simulating real-life physics and displaying them and allowing interaction.

Tips and advice

Just start building, you'll get ideas while building.

Final thoughts and next steps

I would like to extend this project to add many new features, I recieved awesome feedback from reddit and I try to bring those into account.

Try it out here https://theabbie.github.io/DoublePendulum

Discover and read more posts from Abhishek Choudhary
get started
post commentsBe the first to share your opinion
Show more replies