Slopefield face

What if you took a picture and used the brightness of each pixel to determine the angle that a little agent (a black dot) would travel? 

Agents are placed at random on the image, then follow their paths until they go off-screen.
Above, black pixels equated to East and white mapped to West.  There are lots of ways to set the angles. 

Below, an agent’s color is affected by the pixel brightness, and the range of angles is more narrow.

Created with Processing


  1. Love the photo! Just wondering how you were able to make the code for that on processing? I'm attempting to do a project, and I'd like to do something similar to show the slope fields along with a photo.


Post a Comment