Mandelbrot set: Difference between revisions

Content deleted Content added
Majow (talk | contribs)
→‎Normal Maps, Mercator Maps and Deep Zoom Images: Stripes are now independent of height.
Majow (talk | contribs)
→‎Normal Maps, Mercator Maps and Perturbation Theory: Stripes are now independent of height.
Line 6,571: Line 6,571:
n, r = 200, 500 # number of iterations and escape radius (r > 2)
n, r = 200, 500 # number of iterations and escape radius (r > 2)


height, direction = 1.5, 45 # height factor and direction of the incoming light
direction, height = 45, 1.5 # direction and height of the incoming light
v = exp(direction / 180 * pi * im) # unit 2D vector in this direction
v = exp(direction / 180 * pi * im) # unit 2D vector in this direction


Line 6,598: Line 6,598:
U = Z[N] ./ dZ[N]
U = Z[N] ./ dZ[N]
U = U ./ abs.(U) # unit normal vector to the equipotential lines
U = U ./ abs.(U) # unit normal vector to the equipotential lines
S = sin.(100 .* angle.(U)) ./ 10 # perturbation function (stripes)
S = 1 .+ sin.(100 .* angle.(U)) ./ 10 # perturbation function (stripes)
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height .+ S) ./ (1 + height), 0)
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ S .* height) ./ (1 + height), 0)


heatmap(T .^ 1.0, c=:bone_1)
heatmap(T .^ 1.0, c=:bone_1)
Line 6,608: Line 6,608:
U = calculation(log.(abs.(Z[N])), Z[N], dZ[N], ddZ[N])
U = calculation(log.(abs.(Z[N])), Z[N], dZ[N], ddZ[N])
U = U ./ abs.(U) # unit normal vector to the equidistant lines
U = U ./ abs.(U) # unit normal vector to the equidistant lines
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0)
T[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ 1 .* height) ./ (1 + height), 0)


heatmap(T .^ 1.0, c=:afmhot)
heatmap(T .^ 1.0, c=:afmhot)