diff --git a/canvae/PNG.hpp b/canvae/PNG.hpp index 61179b8..468937a 100644 --- a/canvae/PNG.hpp +++ b/canvae/PNG.hpp @@ -72,16 +72,16 @@ public: } } - if(n > 100) { - const double average = cumulative / (double)n; - power[i] = -2.5/log(average/(double)max_int[i]); - if(power[i] < 0) - power[i] = 1; - } else { + + const double average = cumulative / (double)(width*height); + power[i] = -2.5/log(average/(double)max_int[i]); + if(power[i] < 0) { power[i] = 1; + LogInfo("negative power\n"); } - if(n <= width) { + + if(n < width) { LogInfo("not enough data\n"); return; } diff --git a/main.cpp b/main.cpp index e21adc6..44bf13c 100644 --- a/main.cpp +++ b/main.cpp @@ -101,7 +101,7 @@ int main(int argc, char* argv[]) { myAttractor.iterate(); myAttractor.plot(); } - if (j%16 == 0) sleep(1); + //if (j%16 == 0) sleep(1); if(verbose >= 0) { std::cout << "\r" << j << " out of " << iterations << " done." << std::flush; }