38#include "ramCanvas.hpp"
42 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
43 const int MAXITR = 255;
44 const int CCLMAG = 35;
45 const double ZMAGMX = 1e10;
46 const double YCENTR = 0.0;
47 const double ZROEPS = .0001;
48 const int IMGSIZ = 7680/1;
49 const double RELSIZ = 4.0;
50 const double XCENTR = 0.5;
52 std::complex<double> r1( 1.0, 0.0);
53 std::complex<double> r2(-0.5, sin(2*std::numbers::pi/3));
54 std::complex<double> r3(-0.5, -sin(2*std::numbers::pi/3));
55 mjr::ramCanvas3c8b theRamCanvas(IMGSIZ, IMGSIZ, XCENTR-RELSIZ, XCENTR+RELSIZ, YCENTR-RELSIZ, YCENTR+RELSIZ);
57# pragma omp parallel for schedule(static,1)
58 for(
int y=0;y<theRamCanvas.getNumPixY();y++) {
60 if ((y%(IMGSIZ/100))==0)
61 std::cout <<
"line " << y <<
" of " << IMGSIZ << std::endl;
62 for(
int x=0;x<theRamCanvas.getNumPixX();x++) {
63 std::complex<double> z = theRamCanvas.int2real(x, y);
64 for(
int count=0; count<MAXITR; count++) {
65 if(std::abs(z-r1) <= ZROEPS) {
66 theRamCanvas.drawPoint(x, y, mjr::ramCanvas3c8b::colorType::csCCu0R::c(count*CCLMAG));
break;
67 }
else if(std::abs(z-r2) <= ZROEPS) {
68 theRamCanvas.drawPoint(x, y, mjr::ramCanvas3c8b::colorType::csCCu0G::c(count*CCLMAG));
break;
69 }
else if(std::abs(z-r3) <= ZROEPS) {
70 theRamCanvas.drawPoint(x, y, mjr::ramCanvas3c8b::colorType::csCCu0B::c(count*CCLMAG));
break;
71 }
else if(std::abs(z) <= ZROEPS) {
73 }
else if(std::abs(z) > ZMAGMX) {
76 std::complex<double> G = 3.0 * z * z * (r + 1.0) / (pow(z, 3.0) - 1.0) / (pow(z, 3.0) + r);
77 std::complex<double> ABR = 6.0 * sqrt((r + 1.0) * (2.0 * pow(z, 6.0) - pow(z, 3.0) + r) * z /
78 pow(pow(z, 3.0) - 1.0, 2.0) / pow(pow(z, 3.0) + r, 2.0));
79 std::complex<double> ABP = G + ABR;
80 std::complex<double> ABN = G - ABR;
81 std::complex<double> AB = (std::abs(ABP) > std::abs(ABN) ? ABP : ABN);
86 theRamCanvas.writeTIFFfile(
"laguerre_3updown.tiff");
87 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
88 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])