mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
Mandelbrot: Use renormalized fractional iteration count to smooth colors
This commit is contained in:
parent
225ed58f7e
commit
fa026df892
1 changed files with 7 additions and 2 deletions
|
@ -106,8 +106,13 @@ public:
|
|||
if (iteration == max_iterations)
|
||||
return iteration;
|
||||
|
||||
auto lz = sqrt(x * x + y * y) / 2;
|
||||
return 1 + iteration + log(lz / log(2)) / log(2);
|
||||
// Renormalized fractional iteration count from https://linas.org/art-gallery/escape/escape.html
|
||||
// mu = n + 1 - log( log |Z(n)| ) / log(2)
|
||||
auto lz = log(sqrt(x2 + y2));
|
||||
auto mu = iteration + 1 - log(lz) / log(2);
|
||||
if (mu < 0)
|
||||
mu = 0;
|
||||
return mu;
|
||||
}
|
||||
|
||||
static double linear_interpolate(double v0, double v1, double t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue