/** * File: JuliaBase.cc * Copyright (C) 2025 Tyler Triplett * License: GNU GPL 3.0 or later <https://www.gnu.org/licenses/gpl-3.0.html> * * This is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <generators/JuliaBase.hh> namespace ty { JuliaBase::JuliaBase(const int& w, const int& h) : FracBase(w, h) { } std::vector<Setting> JuliaBase::getSettings() { return { {"zf", zoomFactor_}, {"rc", realCenter_}, {"ic", imagCenter_}, {"it", maxIter_}, {"jr", juliaReal_}, {"ji", juliaImaginary_}, }; } JuliaBase::~JuliaBase() { } int JuliaBase::computeIteration(const int& px, const int& py) const { auto z = pixelTranslation(px, py); int iteration = 0; const auto c = Point(juliaReal_, juliaImaginary_); while (abs(z) <= 2.0 && iteration < maxIter_) { z = nextZ(z, c); iteration++; } return iteration; } } /// ty