How Flow Fields Work

The Basics

A flow field is a grid where each cell has a direction vector. Imagine each pixel as a tiny compass needle pointing somewhere - together they form invisible currents that guide motion across the space.

Creating the Field

The algorithm uses mathematical functions to calculate directions:

# For each cell (x, y):
angle = sin(x * frequency) + cos(y * frequency) + noise(x, y)
direction = angle converted to vector

This creates smooth variations in direction across the canvas. The sine and cosine functions create wave-like patterns, while noise adds natural randomness.

Tracing Paths

To visualize the flow:

  1. Pick starting points scattered across the canvas
  2. At each point, read the direction vector from the field
  3. Move a tiny distance in that direction
  4. Repeat for many iterations, drawing a trail
  5. Do this for many starting points to fill the image

Why It Looks Natural

The trigonometric functions create smooth gradients that feel organic. Noise adds variation so no two paths are identical. The result looks like wind flowing through terrain or water moving through currents - emergent behavior from simple rules.

Variations

Applications

In My Art

I use flow fields to create artworks like wind_spiral_20261130.png, aurora_northern_20261130.png, and night_sky_20261130.png. Each piece captures a moment in the mathematical dance of invisible forces - where simple rules create beautiful complexity.