Physics simulations in animated ASCII

Every piece here is a physics simulation in ASCII: pendulums, springs, waves, sand, smoke and orbits moving by the rules of motion and drawn in characters. Gravity pulls, momentum passes down a line of chrome balls, waves add up and cancel, and a soft jelly squashes on landing and wobbles back into shape.

Where to start

They are made for science teachers, physics students and anyone who likes to watch a system settle. Start with the Double Pendulum at Double Pendulum for chaos you can see, or Falling Sand at Falling Sand for grains piling into striped dunes, then explore the quieter pieces: ripples on a pond, a waving flag and a sagging rope bridge.

How the ASCII physics simulations work

Each piece steps a small model forward in time and draws the result as characters, so the motion comes from the physics rather than a hand-drawn path. The ideas behind them are the ones taught in a first physics course:

  • Chaos: in the Double Pendulum, two linked arms make the motion so sensitive to its starting point that the trail never repeats.
  • Momentum: Newtons Cradle passes momentum down a line of chrome balls, first one ball at a time and then two.
  • Gravity: Binary Star Orbit follows Kepler ellipses and speeds up at closest approach, while Three Body Orbit is integrated live over glowing gravity contours.
  • Constraints: Rope Bridge Crossing uses Verlet integration, which moves each point from its last two positions and then pulls neighbors back to their rope length.
  • Soft bodies: Jelly Bounce keeps an internal pressure, so it squashes when it lands and recovers its shape.

Physics animations for lessons and science pages

A moving diagram often explains a concept faster than a paragraph. Match the piece to the topic, embed it on a lesson page, or export a 1080p or 4K video for slides so it plays smoothly on a projector. For more teaching pieces, see Science & Learning at Science & Learning.

  • Projectile motion: Projectile Arcs fires the same charge at four angles so students can compare heights and ranges.
  • Harmonic motion: Spring Mass shows masses at their natural frequencies and a coupled pair trading energy between two normal modes.
  • Waves: Wave Interference and Ripple Pond show superposition, and Pendulum Wave shows how tiny differences in period build patterns.
  • Magnetism: Magnetic Field Lines swings, stretches and reconnects the field as one bar magnet turns.
  • Resonance: Chladni Figures reveals standing waves on a plate through the sand that gathers on the nodes.

Calm loops for backgrounds, loaders and READMEs

Many simulations settle into a gentle rhythm, which makes them good company on a page. Rising Smoke, Ripple Pond and Wave Interference are soft enough to sit behind content. Bouncing Balls, Newtons Cradle, Jelly Bounce and Spring Mass are tagged as loaders because they read as activity without demanding attention. For a README, a GIF of Projectile Arcs or Spring Mass tells visitors the project is about motion before they read a word. Use the speed attribute to slow a piece down, for example speed="0.5" for half speed, or add still to show a single frame where motion would distract from the text around it.

Choosing a look for a simulation

The same simulation can feel scientific, retro or soft depending on how it is drawn. Lissajous Scope already looks like a green oscilloscope, and the Lines look keeps that thin trace feel. Halftone dots suit Rising Smoke, Ripple Pond and Magnetic Field Lines, where density matters more than sharp edges, and the dot size and density sliders let you tune the grain. Blocks give Bouncing Balls a chunky pixel look, and the mono attribute turns any piece into a single color diagram that prints cleanly on a worksheet. Try the looks in the player on each piece page, then set the matching look attribute on your embed tag.

Ways to use ASCII motion lab

Step-by-step guides with a live builder and code to copy.

All 18 use cases →

/FAQS

ASCII motion lab: frequently asked questions

Answers about using ASCII motion lab on websites, in READMEs, in terminals and in exports.

Q. What is a physics simulation in ASCII?
It is a physics model, such as a pendulum, a spring or a field of waves, stepped forward in time and drawn with text characters instead of pixels. Each character cell acts like a coarse pixel, and denser characters show where more is happening. The result is light enough to embed on any page or play in a terminal.
Q. Are these real physics simulations or hand-drawn animations?
They are hand-coded pieces that model the motion rather than trace a drawn path. Projectile Arcs follows true parabolas, Binary Star Orbit follows Kepler ellipses, Three Body Orbit is integrated live and Rope Bridge Crossing uses Verlet integration. They are tuned to look right and loop well, so treat them as demonstrations rather than lab instruments.
Q. Can I use a physics simulation in ASCII in my classroom?
Yes, every piece is MIT licensed, so you can use it in lessons, handouts and course sites. Embed the live piece on a page, export an MP4 for slides, or export a PNG for a worksheet. Pair each piece with the idea it shows, such as Projectile Arcs for launch angles or Spring Mass for normal modes.
Q. How does a pendulum wave work?
A pendulum wave uses pendulums of slightly different lengths, so each one swings with a slightly different period. Released together, they drift out of step and form traveling waves, snakes and apparent chaos, then line up again when their cycles coincide. The Pendulum Wave piece uses fifteen tuned pendulums to show the whole cycle.
Q. What are Chladni figures?
Chladni figures are the patterns that appear when sand is scattered on a vibrating plate. The sand bounces off the parts that move and collects along the nodal lines that stay still, so each frequency draws a different figure. The Chladni Figures piece changes the frequency every so often and redraws the pattern.
Q. Is there an animation of the three-body problem?
Yes, Three Body Orbit shows three equal stars chasing each other around the famous figure-eight solution, drawn over glowing gravity contours. The three-body problem has no general formula, but this special orbit repeats, which makes it perfect for a loop. For two bodies on Kepler ellipses, see Binary Star Orbit.
Q. Where can I see chaos theory in action?
The Double Pendulum at Double Pendulum is the clearest example: two linked arms swing under gravity, and the trail of the lower bob never repeats the same way twice. Tiny differences in where it starts grow into completely different paths. For chaos from pure maths, see the Lorenz Butterfly at Lorenz Butterfly.
Q. How do wave interference patterns form?
They form when waves from two sources overlap: where crest meets crest the waves reinforce, and where crest meets trough they cancel. The cancelled regions make the fan of still nodal lines you see in Wave Interference, which shifts as the two sources drift apart. Ripple Pond shows the same effect with raindrops on water.
Q. What is Verlet integration?
Verlet integration is a way to simulate motion by moving each point based on its current and previous positions, then correcting the distances between connected points. It is popular for ropes, cloth and ragdolls because it stays stable with simple code. Rope Bridge Crossing uses it, so the deck sags and bounces under every step of the hiker.
Q. Can I slow down a simulation on my page?
Yes, set the speed attribute on the embed tag, for example speed="0.5" for half speed or speed="2" for double. You can try speeds in the player on each piece page first. To show one frame with no motion at all, add the still attribute instead.
Q. Can I record a simulation as a video for a talk?
Yes, every piece page exports video as MP4 or WebM at 1920x1080 by default, with a 4K option. A video plays smoothly in presentation software and does not depend on a connection. For a slide deck built on the web, embedding the live piece works too, and the presentations guide at ASCII art for slides and presentations covers both.
Q. Which simulation makes the best loading animation?
Newtons Cradle and Bouncing Balls are the clearest choices, because their steady rhythm reads as work in progress at a glance. Jelly Bounce adds a little character, and Spring Mass is the calmest of the set. Show the embed while your content loads, then remove it when the content arrives.

Related categories

All categories