When you drop a rock into a pond, ripples spread outward from the point of impact as circular waves. (Well, not perfectly circular, but close enough for our purposes…) If you drop two rocks in at different points, the two sets of waves will overlap, creating new and more complicated ripple, or wave, patterns. This is known as interference.
Now, take this basic idea and transfer it into a computer program. Throw in some color, add some more “point sources”, and suspend some real world assumptions (such as diminishing amplitude). In this way you can produce some beautiful or interesting digital images.
If you put several of these wave sources in a circle, and provide a fine grain “resolution” (that is, short wavelengths on the screen), geometric themes appear. Triangles, squares, hexagons, and so forth.
- Interference Pattern with triangular theme.
- Four sources.
- Interference pattern with hexagonal theme.
If we add more sources, our images tend to get more detailed and decorative.
- Seven sources.
- Thirty-one sources.
- Twelve sources.
One nice thing about creating our interference patterns inside of a computer program, is that we can easily adjust the fundamental mathematics involved. For example, the program uses a function to determine the distance between two points, known as a “metric”. We naturally code in the Euclidean metric, which equals the length of a straight line between the two points. Alternatively, we can choose the Manhattan metric, which calculates as though distance can only be transversed in a north-south or east-west direction, like a taxi-cab driver navigating the blocks of downtown Manhattan. Using this function, our images have a markedly different character:
Or let’s do something a little more strange, getting the square root of the original Euclidean metric:
Another interesting metric is to apply a recursive folding function over the Euclidean and Manhattan metrics:
foldAdj :: Float -> Float -> Float -> Float foldAdj base ffactor uval = foldAdj' base uval 0 where foldAdj' stepv remv cumv = if remv - base <= 0 then cumv + stepv * remv / base else foldAdj' (stepv * ffactor) (remv - base) (cumv + stepv)
- Folding Euclidean metric.
- Folding Manhattan metric.
The program used to produce the images in this particular gallery has not yet been released to the public. However, it is written in the Haskell programming language and utilizes the Gloss module to display the images.
- Star-burst interference pattern.
- Folding Manhattan metric.
- Horizontally-aligned sources.
- Four sources.
- Triangles, squares, and curves.
- Attempted combination of the Euclidean and Manhattan metrics.
- Twelve sources.
- Folding Manhattan metric.
- Five sources.
- Folding Euclidean metric.
- Sqrt-Euclidean metric.
- Four-points theme.
- Interference pattern with hexagonal theme.
- Sawtooth wave source function.
- Interference pattern with flower-like geometry.