57#include "ramCanvas.hpp"
58#include "MRMathSFUN.hpp"
59#include "MRMathODE.hpp"
61typedef mjr::ramCanvas1c16b drc_t;
62typedef mjr::color3c8b oc_t;
63typedef mjr::ramCanvasPixelFilter::FuncHomoTransform<drc_t, oc_t> hpf_t;
66std::array<drc_t::coordFltType, 3> eq(std::array<drc_t::coordFltType, 3>
const& p) {
67 const drc_t::coordFltType a = 10.0;
68 const drc_t::coordFltType b = 28.0;
69 const drc_t::coordFltType c = 8.0 / 3;
70 return {a * (p[1] - p[0]),
71 p[0] * (b - p[2]) - p[1],
72 p[0] * p[1] - c * p[2]};
77 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
78 const int XSIZ = 7680/1;
79 const int YSIZ = 4320/1;
81 drc_t theRamCanvas(XSIZ, YSIZ, -200, 200, 10, 40);
83 const drc_t::colorChanType maxPtsPerCurve = drc_t::colorType::maxChanVal;
84 const drc_t::coordFltType tDelta = 0.01;
86# pragma omp parallel for schedule(static,1)
87 for(drc_t::coordIntType yi=0;yi<theRamCanvas.getNumPixY();yi++) {
88 std::cout <<
"Line: " << yi << std::endl;
89 for(drc_t::coordIntType xi=0;xi<theRamCanvas.getNumPixX();xi++) {
90 std::array<drc_t::coordFltType, 3> p {theRamCanvas.int2realX(xi), 1.51, theRamCanvas.int2realY(yi) };
91 int s = mjr::math::sfun::sgn(p[0]);
92 for(drc_t::colorChanType i=0;i<maxPtsPerCurve;i++) {
93 std::array<drc_t::coordFltType, 3> p_new = mjr::math::vec::sum(p, mjr::math::ode::rk4<drc_t::coordFltType, 3>(p, eq, tDelta));
94 if (mjr::math::sfun::sgn(p[0]) != s) {
95 theRamCanvas.drawPoint(xi, yi, i*10);
102 theRamCanvas.writeRAWfile(
"3da_frac_lorenz.mrw");
105 theRamCanvas.writeTIFFfile(
"3da_frac_lorenz.tiff", hpf_t(theRamCanvas,[](
auto inColor) {
return oc_t::csCCfractal0RYBCW::c(inColor.getC0()); }));
107 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
108 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])