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 double ZROEPS = 0.0001;
45 const int IMGSIZ = 7680/1;
46 std::complex<double> r1( 1.0, 0.0);
47 std::complex<double> r2(-0.5, sin(2*std::numbers::pi/3));
48 std::complex<double> r3(-0.5, -sin(2*std::numbers::pi/3));
49 mjr::ramCanvas3c8b theRamCanvas(IMGSIZ, IMGSIZ, -2.0, 2, -2, 2);
51# pragma omp parallel for schedule(static,1)
52 for(
int y=0;y<theRamCanvas.getNumPixY();y++) {
53 for(
int x=0;x<theRamCanvas.getNumPixX();x++) {
54 std::complex<double> z = theRamCanvas.int2real(x, y);
55 for(
int count=0; count<MAXITR; count++) {
56 if(std::abs(z-r1) <= ZROEPS) {
57 theRamCanvas.drawPoint(x, y,
"red");
break;
58 }
else if(std::abs(z-r2) <= ZROEPS) {
59 theRamCanvas.drawPoint(x, y,
"green");
break;
60 }
else if(std::abs(z-r3) <= ZROEPS) {
61 theRamCanvas.drawPoint(x, y,
"blue");
break;
62 }
else if(std::abs(z) <= ZROEPS) {
65 std::complex<double> G = 3.0 * z * z / (pow(z, 3.0) - 1.0);
66 std::complex<double> ABR = 6.0 * sqrt(z / pow(pow(z, 3.0) - 1.0, 2.0));
67 std::complex<double> ABP = G + ABR;
68 std::complex<double> ABN = G - ABR;
69 std::complex<double> AB = (std::abs(ABP) > std::abs(ABN) ? ABP : ABN);
74 theRamCanvas.writeTIFFfile(
"laguerre_simple.tiff");
75 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
76 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])