A rosette is an image with rotational symmetry. For p-fold symmetry we can use the methods of the last post “Anamorphosis and symmetries” with a simple power as a mapping function between output and input images:
Here z=x+iy relates to the position (x,y) of a pixel of the output image. We then have to sample the color of the input image at the position (X,Y) given by Z=X+iY. This gives the color of the pixel. With polar coordinates, where r²=x²+y² and tan(φ)=y/x, we see easily that we have p-fold rotational symmetry. A rotation of (x,y) by 2π/p changes φ to φ+2π/p and gives the same Z. Thus we get the same color for the pixel at the rotated position.
With p=5 I got this result:
We can get more interesting images if we use several combinations of z together with its complex conjugate. As proposed by Farris:
where (m-n) has is a multiple of p for p-fold rotational symmetry. For the power of r we can use any integer number resulting in a more detailed center of the rosette. I find it convenient to rearrange these terms and to use real coordinates. Thus
which is convenient for computation and discussing symmetries. Programming becomes easy, see the end of the rosette.js file. The function mapping(x,y) has first a call to the function imageZero(x,y) for initialization. Then we make calls to the function imageAdd(a,b,c,d,rPower,phiPower), adding terms of the above equations with rPower=k and phiPower=l*p.
We can get more varied images with more detail, such as this one:
Again, I did not use smoothing of pixels.
One last thing: Fight for reason and support the March for Science.