35#include "ramCanvas.hpp"
38double f(
double x,
double y) {
39 return std::pow(x, 2) * std::pow(y, 3) - std::pow(std::pow(x, 2) + std::pow(y, 2) - 1, 3);
44 std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
46 double maxH = std::hypot(512, 512);
47 mjr::ramCanvas3c8b theRamCanvas(1024, 1024, -2, 2, -2, 2);
49 for(y=0;y<theRamCanvas.getNumPixY();y++)
50 for(x=0;x<theRamCanvas.getNumPixX();x++) {
51 if(f(theRamCanvas.int2realX(x), theRamCanvas.int2realY(y)) > 0)
52 theRamCanvas.drawPoint(x, y,
"red");
54 theRamCanvas.drawPoint(x, y, mjr::color3c8b::csPLYquad::c(mjr::math::linm::gen_map(std::hypot(x-512, y-512), maxH, 0.0, 0.5, 1.0)));
57 theRamCanvas.drawString(
"MWU. M", mjr::hershey::font::ROMAN_SL_SANSERIF, 900, 90,
"red", 1, 20);
58 theRamCanvas.drawString(
"2022 ", mjr::hershey::font::ROMAN_SL_SANSERIF, 900, 60,
"red", 1, 20);
59 theRamCanvas.drawString(
" -m", mjr::hershey::font::ROMAN_SL_SANSERIF, 900, 30,
"red", 1, 20);
61 theRamCanvas.writeTIFFfile(
"heart2022.tiff");
62 std::chrono::duration<double> runTime = std::chrono::system_clock::now() - startTime;
63 std::cout <<
"Total Runtime " << runTime.count() <<
" sec" << std::endl;
int main(int argc, char *argv[])