Skip to content
Martin Poiroux
Language : Français
Projects · CodeCode · Prototypes · 2018

Physics simulations

Pendulums, gravitation, a solar system, balls piling up and a keyboard that synthesises its own notes. The equations of the preparatory classes, set in motion in a Pygame window.

Physics classes in the preparatory years hand out equations; these programs give them a screen. No physics engine here: every time step is computed by hand, with the formula from class.

Pendulums. The simple pendulum first, then the double pendulum, whose two angular accelerations follow from the coupled equations of motion. The trace of its tip shows what makes the system interesting: a small difference at the start, and the trajectory has nothing in common any more.

The double pendulum and the trace of its tip: two masses, two angles, and a trajectory that never repeats.

Gravitation. An N-body simulation with the real gravitational constant, where bodies attract each other pairwise, and a solar system, in December 2018, with its planets orbiting the Sun. Collisions between bodies stayed on the to-do list.

The "fluid": hundreds of balls under gravity, piling up and pushing each other at the bottom of the window.

Collisions and fluid. Balls that bounce and hit each other, then hundreds of balls under gravity piling up at the bottom of the window, like a liquid seen very close. It is the same base as the pool table.

3D. An attempt at perspective display with no library at all: points in space projected onto the screen, a camera you can rotate. The file calls itself “botched 3D” and lists what is missing, from lighting to hidden faces.

The first attempt at 3D, with no engine: points in space projected onto the screen by hand.

Sound. A computer keyboard turned into an instrument: each key plays a note whose sine wave is computed sample by sample before being handed to the sound card. Forty-eight notes, four octaves, in French note names. Another form of composition, a more rudimentary one.

Private project, no public link