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 =
x = range(0, 2, length=d+1)
Line 7,998:
for k in 1:n
M =
S[M], T[M] = S[M] .+
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] .+
F = log2.(log.(abs.(Z[N])) ./ log(r)) # fraction between 0 and 1 (for interpolation)
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
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v)
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
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0)
|