Mercurial > lbo > hg > collisions
changeset 6:c10eeaf4015d default tip
Add license, README
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 15 Nov 2020 19:38:16 +0100 |
parents | 9f42b712cc2a |
children | |
files | .hgignore LICENSE README.md plot.gpt |
diffstat | 4 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Sun Nov 15 19:34:01 2020 +0100 +++ b/.hgignore Sun Nov 15 19:38:16 2020 +0100 @@ -1,1 +1,2 @@ ^target/ +.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE Sun Nov 15 19:38:16 2020 +0100 @@ -0,0 +1,1 @@ +Copyright (c) 2020 Lewin Bormann
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Sun Nov 15 19:38:16 2020 +0100 @@ -0,0 +1,18 @@ +# `collisions` + +Implementation of 2D particle box, according to Chapter *Event-driven +Simulation*, in: `Algorithms (4th edition)` by *Robert Sedgewick, Kevin Wayne*. + +This implementation doesn't animate the particles, but instead produces a CSV +file with the columns as follows: + +``` +Particle 1: X | Particle 1: Y | Particle 2: X | Particle 2: Y | ... +``` + +Using the `run.sh` script, you can generate and plot the collision data; +specifically a subsample of six particles. + +This event-driven simulation employs randomly-selected particles with proper +(non-spin non-friction) 2D bouncing, in a lazy-evaluating queue-driven main +loop.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plot.gpt Sun Nov 15 19:38:16 2020 +0100 @@ -0,0 +1,8 @@ +plot \ + "render.csv" using 1:2 title '1' with lines,\ + "render.csv" using 3:4 title '2' with lines,\ + "render.csv" using 5:6 title '3' with lines,\ + "render.csv" using 7:8 title '4' with lines,\ + "render.csv" using 9:10 title '5' with lines,\ + "render.csv" using 11:12 title '6' with lines,\ + ;