Mandelbrot set: Difference between revisions

m
→‎Normal Map Effect, Mercator Projection and Perturbation Theory: Made changes to match Arnaud Chéritat's image.
m (→‎Normal Map Effect, Mercator Projection and Deep Zoom Images: Added Jussi Härkönen's paper and made changes to match Arnaud Chéritat's image.)
m (→‎Normal Map Effect, Mercator Projection and Perturbation Theory: Made changes to match Arnaud Chéritat's image.)
Line 7,986:
 
direction, height = 45, 1.5 # direction and height of the incoming light
stripes, damping = 104, 2.0 # stripe density and damping parameter
 
x = range(0, 2, length=d+1)
Line 7,998:
 
for k in 1:n
M = abs2abs.(Z) .< abs2(r)
S[M], T[M] = S[M] .+ sincos.(stripes .* angle.(Z[M])), T[M] .+ 1
Z[M], dZ[M], ddZ[M] = Z[M] .^ 2 .+ C[M], 2 .* Z[M] .* dZ[M] .+ 1, 2 .* (dZ[M] .^ 2 .+ Z[M] .* ddZ[M])
end
 
N = abs.(Z) .>= r # normal map effect 1 (potential function)
P, Q = S[N] ./ T[N], (S[N] .+ sincos.(stripes .* angle.(Z[N]))) ./ (T[N] .+ 1)
F = log2.(log.(abs.(Z[N])) ./ log(r)) # fraction between 0 and 1 (for interpolation)
HR = Q .+ (P .- Q) .* F .* PF .+* (13 .- F)2 .* QF) # heighthermite perturbationinterpolation (byr linearis interpolationbetween q and p)
U, H = Z[N] ./ dZ[N], 1 .+ R ./ damping # normal vectors to the equipotential lines and height perturbation
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit normal vectors and unitvector 2Din vectorlight direction
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ (1 .+ H ./ damping) .* height) ./ (1 + height), 0)
 
heatmap(D .^ 1.0, c=:bone_1)
Line 8,016:
N = abs.(Z) .>= r # 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 unitvector 2Din vectorlight direction
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0)
 
305

edits