52#include "ramCanvas.hpp"
56 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
57 const int XSIZ = 7680/1;
58 const int YSIZ = 4320/1;
59 mjr::ramCanvas3c8b theRamCanvasX0(XSIZ, YSIZ, -10, 10, -10, 10);
60 mjr::ramCanvas3c8b theRamCanvasY0(XSIZ, YSIZ, -10, 10, -10, 10);
61 mjr::ramCanvas3c8b theRamCanvasZ0(XSIZ, YSIZ, -10, 10, -10, 10);
62 mjr::ramCanvas3c8b theRamCanvasXY(XSIZ, YSIZ, -10, 10, -10, 10);
63 mjr::ramCanvas3c8b theRamCanvasXZ(XSIZ, YSIZ, -10, 10, -10, 10);
64 mjr::ramCanvas3c8b theRamCanvasYZ(XSIZ, YSIZ, -10, 10, -10, 10);
66 double isectDistToGo = 1e8;
67 double curveDistToGo = 1e4;
75 double targetDist = 0.025;
76 int maxNumUpBisect = 5;
77 int maxNumDownBisect = 10;
85 double Xdelta, Ydelta, Zdelta, movDist;
86 while (dist < isectDistToGo) {
90 tDelta += (2 * tDelta);
91 Xdelta = (y) * tDelta;
92 Ydelta = (-x-z*y) * tDelta;
93 Zdelta = (y*y-a+b*z) * tDelta;
94 movDist = sqrt (fabs (Xdelta * Xdelta + Ydelta * Ydelta + Zdelta * Zdelta));
96 }
while ((numUpBisect < maxNumUpBisect) && (movDist < targetDist));
99 int numDownBisect = 0;
102 Xdelta = (y) * tDelta;
103 Ydelta = (-x-z*y) * tDelta;
104 Zdelta = (y*y-a+b*z) * tDelta;
105 movDist = sqrt (fabs (Xdelta * Xdelta + Ydelta * Ydelta + Zdelta * Zdelta));
107 }
while ((numDownBisect < maxNumDownBisect) && (movDist > targetDist));
114 if (dist < curveDistToGo) {
115 theRamCanvasXY.drawPoint(x, y, mjr::ramCanvas3c8b::colorType::cornerColorEnum::WHITE);
116 theRamCanvasXZ.drawPoint(x, z, mjr::ramCanvas3c8b::colorType::cornerColorEnum::WHITE);
117 theRamCanvasYZ.drawPoint(y, z, mjr::ramCanvas3c8b::colorType::cornerColorEnum::WHITE);
121 theRamCanvasZ0.drawPoint((x+xOld)/2.0, (y+yOld)/2.0, theRamCanvasZ0.getPxColor((x+xOld)/2.0, (y+yOld)/2.0).setC0(255));
123 theRamCanvasZ0.drawPoint((x+xOld)/2.0, (y+yOld)/2.0, theRamCanvasZ0.getPxColor((x+xOld)/2.0, (y+yOld)/2.0).setC2(255));
125 theRamCanvasZ0.drawPoint((x+xOld)/2.0, (y+yOld)/2.0, theRamCanvasZ0.getPxColor((x+xOld)/2.0, (y+yOld)/2.0).setC1(255));
129 theRamCanvasX0.drawPoint((y+yOld)/2.0, (z+zOld)/2.0, theRamCanvasX0.getPxColor((y+yOld)/2.0, (z+zOld)/2.0).setC0(255));
131 theRamCanvasX0.drawPoint((x+xOld)/2.0, (y+yOld)/2.0, theRamCanvasX0.getPxColor((y+yOld)/2.0, (z+zOld)/2.0).setC2(255));
133 theRamCanvasX0.drawPoint((y+yOld)/2.0, (z+zOld)/2.0, theRamCanvasX0.getPxColor((y+yOld)/2.0, (z+zOld)/2.0).setC1(255));
137 theRamCanvasY0.drawPoint((x+xOld)/2.0, (z+zOld)/2.0, theRamCanvasY0.getPxColor((x+xOld)/2.0, (z+zOld)/2.0).setC0(255));
139 theRamCanvasY0.drawPoint((x+xOld)/2.0, (y+yOld)/2.0, theRamCanvasY0.getPxColor((x+xOld)/2.0, (z+zOld)/2.0).setC2(255));
141 theRamCanvasY0.drawPoint((x+xOld)/2.0, (z+zOld)/2.0, theRamCanvasY0.getPxColor((x+xOld)/2.0, (z+zOld)/2.0).setC1(255));
148 theRamCanvasXY.writeTIFFfile(
"attracting_torus_shadowXY.tiff");
149 theRamCanvasXZ.writeTIFFfile(
"attracting_torus_shadowXZ.tiff");
150 theRamCanvasYZ.writeTIFFfile(
"attracting_torus_shadowYZ.tiff");
151 theRamCanvasZ0.writeTIFFfile(
"attracting_torus_shadowZ0.tiff");
152 theRamCanvasX0.writeTIFFfile(
"attracting_torus_shadowX0.tiff");
153 theRamCanvasY0.writeTIFFfile(
"attracting_torus_shadowY0.tiff");
155 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
156 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])