File:RandomWalk.gif

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

RandomWalk.gif(128 × 128 pixels, file size: 505 KB, MIME type: image/gif, looped, 501 frames, 15 s)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description A brownian motion-like random walk of three particles (from the same starting position) for 10000 steps; frames illustrate every tenth step with colour fading to simulate motion blur/persistence of vision. Individual random walks created with ImageJ (for the macro see below), the colours inverted, and combined to a single RGB image.
Date
Source I created this work entirely by myself.
Author Richard Wheeler (Zephyris)

ImageJ Macro[edit]

newImage("Random Walk", "8-bit White", 128, 128, 1);
length=5000;
bias=0.0;
setColor(255);
x=round(getWidth()/2);
y=round(getHeight()/2);
setPixel(x,y,0);
drand=random();
if (drand>=0 && drand<0.125) {
dir=1;
} else if (drand>=0.125 && drand<0.250) {
dir=2;
} else if (drand>=0.250 && drand<0.375) {
dir=3;
} else if (drand>=0.375 && drand<=0.500) {
dir=4;
} else if (drand>=0.500 && drand<=0.625) {
dir=5;
} else if (drand>=0.625 && drand<=0.750) {
dir=6;
} else if (drand>=0.750 && drand<=0.875) {
dir=7;
} else if (drand>=0.875 && drand<=1) {
dir=8;
}
for (l=0; l<length/10; l++) {
setSlice(l+1);
for (j=0; j<10; j++) {
if (random()<=bias) {
dir=dir;
} else {
drand=random();
if (drand>=0 && drand<0.125) {
dir=1;
} else if (drand>=0.125 && drand<0.250) {
dir=2;
} else if (drand>=0.250 && drand<0.375) {
dir=3;
} else if (drand>=0.375 && drand<=0.500) {
dir=4;
} else if (drand>=0.500 && drand<=0.625) {
dir=5;
} else if (drand>=0.625 && drand<=0.750) {
dir=6;
} else if (drand>=0.750 && drand<=0.875) {
dir=7;
} else if (drand>=0.875 && drand<=1) {
dir=8;
}
}
if (dir==1) {
x=x+1;
y=y;
} else if (dir==2) {
x=x;
y=y+1;
} else if (dir==3) {
x=x-1;
y=y;
} else if (dir==4) {
x=x;
y=y-1;
} else if (dir==5) {
x=x+1;
y=y+1;
} else if (dir==6) {
x=x+1;
y=y-1;
} else if (dir==7) {
x=x-1;
y=y+1;
} else if (dir==8) {
x=x-1;
y=y-1;
}
if (x>=getWidth()) {
x=0;
} else if (x<0) {
x=getWidth()-1;
}
if (y>=getHeight()) {
y=0;
} else if (y<0) {
y=getHeight()-1;
}
setPixel(x,y,0+25.5*j);
updateDisplay();
}
run("Add Slice");
run("Select All");
fill();
}

Licensing[edit]

wikipedia user Zephyris, the copyright holder of this work, hereby publishes it under the following license:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current15:09, 5 February 2010Thumbnail for version as of 15:09, 5 February 2010128 × 128 (505 KB)Toobaz (talk | contribs)== Summary == {{Information |Description = A brownian motion-like random walk of three particles (from the same starting position) for 10000 steps; frames illustrate every tenth step with colour fading to simulate motion blur/persistence of visio

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: