feat: Use perturbed Mandelbrot iterant

This commit is contained in:
Leni Aniva 2025-06-03 15:24:36 -07:00
parent 76e2c11911
commit 2783589cc0
Signed by: aniva
GPG Key ID: D5F96287843E8DFB
2 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,7 @@ Then generate the fractal using the pseudomandelbrot function
```julia
include("src/fractal.jl")
mandel(img, -3-2im, 2+2im)
mandel(img, -0.53+0.60im, -0.51+0.62im)
```
The coördinates specified are the bottom left and top right, respectively.

View File

@ -18,6 +18,9 @@ function is_stable(m, z1, z2, c)
y1 = imag(z1)
x2 = real(z2)
y2 = imag(z2)
u = (real(c) - x1) / (x2 - x1)
v = (imag(c) - y1) / (y2 - y1)
f = sample(m, u, v)
z = c
for _ in 1:iter
r = abs(z)
@ -29,7 +32,7 @@ function is_stable(m, z1, z2, c)
v = (imag(z) - y1) / (y2 - y1)
f = sample(m, u, v)
if f < 0.5
z = z^2/8 + c
z = z^2*0.99 + c
else
z = z^2 + c
end