I started with the target image here on the right. I then used a genetic algorithm to try to find an approximation of this image as a sum of cosine waves. Each cosine wave has the following form fᵢ(x,y) = Aᵢ cos( 2 π ( x cos θᵢ + y cos θᵢ) ωᵢ + 2 π ϕᵢ ) The genetic algorithm can tweak the amplitude Aᵢ, the orientation in the plane θᵢ, the frequency ωᵢ, and the phase ϕᵢ of each wave. The image at the right here, is from the 443rd generation of a population of 200 where each gene represents 100 cosine waves. For the video below, I used a population of 100 genes, each representing the sum of 50 cosine waves.
- Jeff Daly