I77 Answer ― Multiple Cycles


Here is the relevant part of the solution:

  for ( r=0; r<nrows; r++ )
    for ( c=0; c<ncols; c++ )
   {
      dist    = sqrt( (r-cntR)*(r-cntR) + (c-cntC)*(c-cntC)) ;
      thetaCC = atan2( (c-cntC), (r-cntR) );
      radians = 2*M_PI*(dist/radius) ;
      red     = 125 + 125*cos( radians*redRCycles + thetaCC*redCCCycles );
      grn     = 125 + 125*cos( radians*grnRCycles + thetaCC*grnCCCycles );
      blu     = 125 + 125*cos( radians*bluRCycles + thetaCC*bluCCCycles );
      fputc( red, image );  fputc( grn, image );  fputc( blu, image );
    }

Comments: Again, this puzzle is mostly an exercise in parameter gathering. If you really wanted to gather parameters, you might make the amplitude of the waves parameters, also. In the above, the amplitudes are hard-coded at 125.