Pixies

This is an experimental application that uses different mathematical equations to control the behavior of a number of pixels on the screen. Each pixel, or Pixie, has its own position, velocity, and direction. The direction is a vector whose value goes from 0 to 2pi. The direction of each pixie depends on what it's closest neighbors are doing and which mathematical equation is selected. These different equations produce different behaviors. So far I have come up with four different behaviors.

  • Schooling - Simply sets the direction to the direction of a neighbor. d0 = d1
  • Swarming - Sets the direction to 1 divided by the velocity of a neighbor. d0 = 1 / v1
  • Swirling - Sets the direction using trig functions and the direction of a neighbor. d0 = 2pi * sin(tan(d1))
  • Avoidance - Sets the direction to direction of a neighbor plus PI (opposite direction). d0 = d1 + pi

Start the app by clicking the button below. If you don't see a button you probably don't have Java Runtime Envinronment (JRE) installed (you need version 1.1 or later). You can add more pixies by clicking the mouse. When you click the left mouse button it adds 1 pixie. If you click the right button it adds 10 pixies.