40#include "ramCanvas.hpp"
43typedef mjr::ramCanvas3c8b rcT;
47 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
48 const int MAXITR = 255;
49 const int COLMAG = 300;
50 const int CCLMAG = 300;
51 const double ZMAGMX = 1e10;
52 const double RELSIZ = 2.1;
53 const double XCENTR = 0.35;
54 const double YCENTR = 0.0;
55 const double ZROEPS = .0001;
56 const int IMGSIZ = 7680/1;
58 std::complex<double> r1( 1.0, 0.0);
59 std::complex<double> r2(-0.5, sin(2*std::numbers::pi/3));
60 std::complex<double> r3(-0.5, -sin(2*std::numbers::pi/3));
61 rcT theRamCanvas(IMGSIZ, IMGSIZ, XCENTR-RELSIZ, XCENTR+RELSIZ, YCENTR-RELSIZ, YCENTR+RELSIZ);
63# pragma omp parallel for schedule(static,1)
64 for(
int y=0;y<theRamCanvas.getNumPixY();y++) {
66 if ((y%(IMGSIZ/100))==0)
67 std::cout <<
"line " << y <<
" of " << IMGSIZ << std::endl;
68 for(
int x=0;x<theRamCanvas.getNumPixX();x++) {
69 std::complex<double> z = theRamCanvas.int2real(x, y);
70 for(
int count=0; count<MAXITR; count++) {
72 if(std::abs(z-r1) <= ZROEPS) {
73 theRamCanvas.drawPoint(x, y, rcT::colorType::csCCu0R::c(count*CCLMAG));
break;
74 }
else if(std::abs(z-r2) <= ZROEPS) {
75 theRamCanvas.drawPoint(x, y, rcT::colorType::csCCu0G::c(count*CCLMAG));
break;
76 }
else if(std::abs(z-r3) <= ZROEPS) {
77 theRamCanvas.drawPoint(x, y, rcT::colorType::csCCu0B::c(count*CCLMAG));
break;
78 }
else if(std::abs(z) <= ZROEPS) {
82 if(std::abs(z) > ZMAGMX) {
83 theRamCanvas.drawPoint(x, y, rcT::colorType::csCCu0W::c(count*COLMAG));
break;
87 z = (-pow(z, 0.6e1) + (0.2e1 * r + 0.4e1) * pow(z, 0.3e1) + r) * pow(z, -0.2e1) / (r + 0.1e1) / 0.3e1;
91 theRamCanvas.writeTIFFfile(
"newton_3updown.tiff");
92 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
93 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])