50#include "ramCanvas.hpp"
54 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
55 std::cout <<
"apollony start" << std::endl;
56 const int CSIZE = 1080*2;
57 const int ITRTOSS =
static_cast<int>(std::pow(2, 10));
58 const long NUMITR =
static_cast<int>(std::pow(2, 29));
60 mjr::ramCanvas3c8b theRamCanvas(CSIZE, CSIZE, -4.0, 4.0, -4.0, 4.0);
61 theRamCanvas.setDrawMode(mjr::ramCanvas3c8b::drawModeType::ADDCLAMP);
63#if SUPPORT_DRAWING_MODE
64 mjr::ramCanvas3c8b::colorType aColor[] = { mjr::ramCanvas3c8b::colorType(1, 0, 0),
65 mjr::ramCanvas3c8b::colorType(0, 1, 0),
66 mjr::ramCanvas3c8b::colorType(0, 0, 1) };
68 mjr::ramCanvas3c8b::colorType aColor[] = { mjr::ramCanvas3c8b::colorType(255, 0, 0),
69 mjr::ramCanvas3c8b::colorType(0, 255, 0),
70 mjr::ramCanvas3c8b::colorType(0, 0, 255) };
73 std::random_device rd;
74 std::minstd_rand0 rEng(rd());
76 const double s = 1.73205080757;
77 const std::complex<double> si(0, s);
78 const std::complex<double> c1 = (1+s)/(2+s);
79 const std::complex<double> c2 = 0.5*(si-1.0);
80 const std::complex<double> c3 = -0.5*(si+1.0);
81 const std::complex<double> c4 = 1.0+s;
82 const std::complex<double> c5(3.0, 0.0);
83 std::complex<double> z(0.1, 0.2);
84 for (
long n=0;n<NUMITR;n++) {
85 std::complex<double> zNxt;
86 if ((n % (NUMITR/100)) == 0) {
87 if ((n % (NUMITR/10)) == 0)
88 std::cout <<
"|" << std::flush;
90 std::cout <<
"." << std::flush;
92 std::complex<double> f = c5/(c4-z)-c1;
93 std::minstd_rand0::result_type rn = rEng()%3;
104 theRamCanvas.drawPoint(z, aColor[rn]);
106 std::cout <<
"|" << std::endl;
107 std::cout <<
"apollony dump" << std::endl;
108 theRamCanvas.applyHomoPixTfrm(&mjr::ramCanvas3c8b::colorType::tfrmStdPow, 1/5.0);
109 theRamCanvas.writeTIFFfile(
"apollony.tiff");
110 std::cout <<
"apollony finish" << std::endl;
111 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
112 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])