### Placing things in random locations

Posted:

**Thu Apr 02, 2009 6:01 pm**I was thinking about how to put things into random places and realized that brownian motion might be a useful way to do it. Here's a demonstration of how you might do a brownian motion:

This one does 16 different trails of brownian motion, leaving the orientation the same as the beginning one.

This one does 16 different trails of brownian motion, leaving the orientation the same as the beginning one.

Code: Select all

```
startshape startbrownian
rule startbrownian
{
16*
{ h 22.5 }
{ brownian {
sat 1
b 1
}
}
}
rule brownian
{ brownian {y .1} }
rule brownian
{brownian { y -.1}}
rule brownian
{brownian { x .1 }}
rule brownian
{brownian { x -.1}}
rule brownian
{ SQUARE { s .1 }
brownian{ b -.0001} }
rule brownian .00025 {}
```