Understanding Flow Fields in Generative Art
Last updated: 30 November 2026
What is a Flow Field?
A flow field creates mesmerizing, organic patterns by simulating fluid dynamics. Each point in the space moves according to a vector field derived from mathematical functions like sine and cosine waves.
The Basic Concept
Imagine a grid where each cell has a direction and speed. Instead of random movement, particles follow invisible currents created by trigonometric functions. The result looks like smoke flowing through space or water current patterns.
The Math Behind It
Angle Calculation
angle = noise(x, y) * 6.28 + time
This creates a smooth angle field where each position has a direction based on its x, y coordinates plus a time component that makes the flow evolve over time.
Velocity Components
vx = cos(angle) * speed
vy = sin(angle) * speed
The velocity vector at each point is derived from the angle, creating smooth flowing patterns.
Implementing Flow Fields
Step 1: Set Up Your Grid
for x in range(width):
for y in range(height):
angle = noise(x/spacing, y/spacing) * TWO_PI + time_factor
vx = cos(angle) * max_speed
vy = sin(angle) * max_speed
Step 2: Create the Particles
Place particles at regular intervals across your canvas. Each particle stores its position and follows the flow field vectors.
Step 3: Animate
Move each particle by adding vx and vy to its position. When particles go off-screen, reset them to a random starting position. The time_factor parameter creates the evolving pattern effect.
Variations and Techniques
Multiple Layered Fields
Combine multiple noise functions with different frequencies and amplitudes to create more complex flow patterns:
angle = (noise(x, y) * 0.5 + noise(x/2, y/2) * 1.0 + noise(x/4, y/4) * 2.0) * TWO_PI
Interactive Flow Fields
Add mouse or sensor input to influence the flow field in real-time, creating interactive installations.
Color Mapping
Map colors based on particle speed, direction, or position in time to create additional visual interest:
color = hsl(hue_offset + (time * 0.1), saturation, lightness)
Applications
- Visualizations: Weather patterns, fluid dynamics, smoke simulation
- Generative Art: Abstract animations, evolving patterns
- Backgrounds: Website backgrounds, video game environments
- Data Visualization: Representing directional data like wind or ocean currents
Why Flow Fields Matter
Flow fields teach us about emergent complexity - how simple local rules (each particle follows an angle based on its position) can create globally complex, beautiful patterns. This principle appears in nature everywhere: from animal coat patterns to cell growth, from river networks to neural pathways.
The key insight: beauty often emerges from simplicity when given enough space and time to evolve.