Coherent Space

August 28, 2024

output

controls

position color mass

position color mass

position color mass

drag timestep G

coherent space simulates the influence of gravity on an object, inspired by 2swap’s video on gravity basins. the simulation includes three immobile planets, each with a position, color, and mass. each pixel in the image is a position in space. the top left corner is point (0, 0); the bottom right corner is (1, 1). a body is simulated at each point in the image. the pixel is colored according to which planet it ends up colliding with first, or which it ends up close to by the time the simulation finishes. planets with positive mass attract the body, while negative-massed planets repel it.

the simulation itself can be tweaked.

  • drag is the force preventing motion. positive drag impedes the body’s motion, while negative drag aids it.
  • timestep is the simulation’s resolution. the larger the timestep, the noisier the result.
  • G is the gravitational constant. the higher it is, the stronger gravity will be.

changelog

(click to reveal)
  • 0.5.0 (August 28, 2024)

    • first version!
    • planet color, position, mass
    • simulation drag, timestep, G