From 72e6cbfc6a4b4606f11a6d5285de65238dc0dbd4 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 9 Nov 2022 17:12:04 -0500 Subject: Added dla2csv, dla2img. Split up docs. --- ALGORITHM.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ALGORITHM.txt (limited to 'ALGORITHM.txt') diff --git a/ALGORITHM.txt b/ALGORITHM.txt new file mode 100644 index 0000000..5b6e00b --- /dev/null +++ b/ALGORITHM.txt @@ -0,0 +1,24 @@ +DLA Algorithm +------------- + +The algorithm works like this: + +1. The initial "seed" pixels are drawn. + +2. Each particle starts on the edge of a circle whose center is the + center of the screen. The circle's radius depends on the number + of particles that have been rendered so far: radius is 15 for + particles 1 to 100, 30 for particles 101 to 300, 45 for particles + 301 to 600, and 75 for particles 601 and up. + +3. Walk the particle around randomly. For each step, pick a random one + of the 4 cardinal directions (no diagonals). + +4. If the particle goes "out of bounds" (see below), respawn it and + try again (without incrementing the particle counter). + +5. If the particle is ever adjacent to a set pixel, it gets stuck + there, the particle counter is incremented, and we go back to step 2. + +When the particle counter reaches the max (the number the user +entered), the process is complete. -- cgit v1.2.3