Mandelbrot set: Difference between revisions

m
Line 7,986:
 
direction, height = 45, 1.5 # direction and height of the incoming light
stripes, damping = 5.010, 2.0 # stripe density and damping parameter
 
x = range(0, 2, length=d+1)
Line 8,003:
end
 
N = abs.(Z) .>= 2r # exteriornormal distancemap estimationeffect 1 (potential function)
D[N] = log.(abs.(Z[N])) .* abs.(Z[N]) ./ abs.(dZ[N])
 
heatmap(D .^ 0.1, c=:balance)
savefig("Mandelbrot_distance_est.png")
 
N = abs.(Z) .> 2 # normal map effect 1 (potential function)
P, Q = S[N] ./ T[N], (S[N] .+ sin.(stripes .* angle.(Z[N]))) ./ (T[N] .+ 1)
F = 1 .- log2.(log.(abs.(Z[N])) ./ log(r)) # fraction between 0 and 1 (for interpolation)
H = F .* P .+ (Q1 .- PF) .* FQ .* F# .*height perturbation (3by .-linear 2 .* Finterpolation) # hermite interpolation
U = Z[N] ./ dZ[N] # normal vectors to the equipotential lines
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit normal vectors and unit 2D vector
Line 8,020 ⟶ 8,014:
savefig("Mandelbrot_normal_map_1.png")
 
N = abs.(Z) .>= 2r # normal map effect 2 (distance estimation)
U = Z[N] .* dZ[N] .* ((1 .+ log.(abs.(Z[N]))) .* conj.(dZ[N] .^ 2) .- log.(abs.(Z[N])) .* conj.(Z[N] .* ddZ[N]))
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit normal vectors and unit 2D vector
305

edits