8 Queens Problem
Abhivadaye
Anagram Finder
Bouncing Spheres
Break Out
Classic Snake
Cycloids
Deflection Demo
Double Pendulum
EV Savings
Flocking
Fog fly through
Forces on Objects
Fractals
Game of Life
Horizontal Stars
Image Scanning
JSON Beautify
Julia Sets
Kaleidoscope
Kock Fractals
Lorenz Attractor
Mandlebrot Set
Meta Balls
Natural Flocking
Number Convert
Number Game
Pandemic Simulator
Particles & Nodes
Perlin Noise
Poisson Disk
QuadTree Search
Ripples
Set Demonstration
Sierpiński Triangles
Simple Pendulum
Sine Waves
Starfield
Super Shapes 2D
Target Finder
Tic Tac Toe
Voronoi Diagram
Who Moved My...
Simple Pendulum
Here's a simulation of some simple pendulums. I think what surprised me most about coding this was the realization that the mass of the
bob of the pendulum has NO say in its period. Only the length and the acceleration of gravity matter.
22 Nov 2019
Sorry, your browser does not support Canvas.
Variable | Value Range | Value |
Gravity | 0.1 - 280 m/s |
Presets : |
Damping | 0.900 - 1.000 | |
Trace | ||
FPS | ||
Show/Hide |
I know that the demo above looks very busy. You can turn off or on the pendulums and other animations on the demo and then you'll be left with just this realization. That behind all the "busy-ness" are just two calculations. One is to calculate the position of the bob of the pendulum based on the force and the other is to calculate the force itself.
![]() |
On the image to the left, I did my best to explain the way to calculate the force on the bob of the pendulum. This is highlighted
as the red line in the image (fc).
We know the values of the following variables.
SIN(a) = force to calculate (fc) / force of gravity (fg); Thus fc = fg / SIN(a) This gives us the force (or acceleration) that acts on the pendulum. |
![]() |
Once we know the force, we know how fast or slow the angle changes. With the angle we can easily calculate the
position of the bob. The image on the left shows how. We know two values. The angle (a) and the
length (l). Using the SOHCAH method we calculate the position of the bob. X Position = SIN(angle) * length Y Position = COS(angle) * length |