feat: Use perturbed Mandelbrot iterant
This commit is contained in:
parent
76e2c11911
commit
2783589cc0
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue