Hue is a cyclic variable going from red to yellow, green, cyan, blue, magenta and then back to red again. Thus it behaves like an angle. Using full saturation and brightness we then calculate such a space-dependent angle or hue to create new, very colorful images.
Two different wave functions f(x,y) and g(x,y) define a vector with components (f, g). The vector has an angle α(x,y) to the x-axis, essentially defined by tan(α)=[f(x,y)/g(x,y)]. Take care to use the atan2-function in programs.
In our first example we use the two components of the pattern with eight-fold rotational symmetry. They are f=cos(x)+cos(y) and g=cos[(x+y)/sqrt(2)]+cos[(-x+y)/sqrt(2)]. This gives us a design with a two-color eight-fold rotational symmetry. A rotation by 45 degrees exchanges red and green. Blue seems to be a neutral color, that does not change:
For twelve-fold rotational symmetry we use the two hexagonal wave functions in the same way. Here, the two-color symmetry is easier to see: