Weave

2022-08-12 11:11

Don’t even know whose bed I’m in…

The (pseudo)code below generates a number of points in a plane or, simply put, a picture:


Goals = [(0, 0), (1, 0), (0.5, sqrt(3)/2)];
curr = random(Goals);

for i = 1:N
    dest = random(Goals);
    next = 1/2 * (curr + dest);
    curr = next;

The process is defined by a set of goals (Goals), a single rule (move half-way (1/2) to a chosen goal) and chance (random()). Can you predict how the picture of N points will look?

One possible result:

The final picture is fixed; it depends only on the goals and rule(s). However, the randomness ensures that its structure becomes clear only for large number of points, and each path to it (trajectory) may be different.

I invite you to think why I’m choosing this particular example to introduce a blog.

 

* * *

 

I can already hear the protestations of those who find their inner self to be obviously richer than some trivial rule; also, why start with dunce-cap triangle? The fact is, for a complete square no structure ever emerges:

Show

However, unreachable obstacles in the path result in… something completely different:

Show

(Source code and comments will be provided in a separate entry.)




Comments

  1. ST, Friday August 12th, 2022 11:11 AM #

    Ceci n’est pas une pipe.