Logo by mauxuam - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. April 23, 2024, 11:33:49 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Mandelbrot distance estimation problem  (Read 755 times)
0 Members and 1 Guest are viewing this topic.
Iariak
Alien
***
Posts: 26



« on: November 18, 2016, 10:30:26 PM »

So I tried to implement distance estimation into my VBA program because I really liked the images you can get with that (been doing everything using escape time so far).

However, because my idea of what derivation is is extremely vague (and from what I understand, it is used in distance estimation) I ended up ripping the extra code needed for DE off of another thread on this forum (namely this one: http://www.fractalforums.com/mandelbrot-and-julia-set/problem-with-mandelbrot-distance-estimator/)

here is my code:
Code:
Sub render()

For i = -2 To 2 Step 0.01
    counteri = counteri + 1
    counterj = 0
    DoEvents
    For j = -2 To 2 Step 0.01
        counterj = counterj + 1
        iterate = iterateM(i, j)
        Cells(counteri, counterj).Interior.Color = RGB(iterate, iterate, iterate)
    Next j
Next i

End Sub

Function iterateM(ByVal j0 As Double, ByVal i0 As Double) As Long


For k = 1 To 200
    iDer = 2 * (i * iDerz - j * jDerz) + 1
    jDer = 2 * (i * jDerz + j * iDerz)
    iDerz = iDer
    jDerz = jDer
    
    i = iz * iz - (jz * jz) + i0
    j = 2 * iz * jz + j0
    iz = i
    jz = j
    mag = Sqr(i * i + j * j)
    If mag > 2 Then
        dr = Sqr(iDer * iDer + jDer * jDer)
        dist = mag * Log(mag) / dr
        patri = dist * 500
        Exit For
    End If
Next k
iterateM = patri
End Function
Now it kinda works, this is one of the pictures I was able to get with that
Mandelbrot set zoom
What bothers me though that if that image was darker, there would be visible "straps" just like the ones you get with escape time, you can see that on this image (this is the whole set)
Whole Mandelbrot using DE

If anyone has any idea what I did wrong, let me know please. Thanks!
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #1 on: November 19, 2016, 07:53:11 AM »

i dont know if it is your only problem but try a larger bailout
Logged
Iariak
Alien
***
Posts: 26



« Reply #2 on: November 19, 2016, 09:54:44 AM »

Naw man, 200 is enough for the whole set. The picture is so dark just because I wanted the straps to be visible. If it was brighter, it would look just fine. Thanks for taking your time to go through the code though Grin with closed eyes
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #3 on: November 19, 2016, 11:02:43 AM »

i wasnt asking, i was telling.  also your bailout in that code is 2, not 200.   i guess 200 is your maxiter there.   afro
Logged
Adam Majewski
Fractal Lover
**
Posts: 221


WWW
« Reply #4 on: November 19, 2016, 11:18:53 AM »

IMHO problem is int the code which computes color from distance estimation.
Try to chang coloring :
* if interior then red
* if exterior
** if distance < 10*pixel_size then black
** else white

Show result

HTH

BTW
https://en.wikibooks.org/wiki/Fractals/Iterations_in_the_complex_plane/demm
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #5 on: November 19, 2016, 11:31:10 AM »

well, the code is obviously just a basic (pun intended?) example in any case.  his question though,

Quote
if that image was darker, there would be visible "straps"

relates to his intentionally using a larger multiplier (500 instead of your suggested 10).
and again, i suspect if his bailout matched or exceeded this value it could produce better results.
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #6 on: November 19, 2016, 02:29:46 PM »

Like quaz0r said, you need to change "If mag > 2" to increase the escape radius. Attached is a comparison, showing that the "straps" reduce when the radius is increased, no harm going huge like R = 1e6 or so because once it escapes 2 it grows very fast.  The bigger the radius, the more accurate the distance estimate.


* escape-radius-distance-estimate-comparison.png (163.31 KB, 1536x1024 - viewed 95 times.)
Logged
Iariak
Alien
***
Posts: 26



« Reply #7 on: November 19, 2016, 04:14:35 PM »

Oh sorry I didn't know that number was called a bailout and assumed you meant the max iterations x) Anyway that was totally it! It would never occur to me that changing that number would have any effect, I always used 2. Anyway thanks a bunch to all of you, it works beautifully.


* MandelbrotFixed2.jpg (124.46 KB, 693x620 - viewed 83 times.)
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Convergent Distance Estimation Programming David Makin 9 9754 Last post November 28, 2008, 10:27:01 PM
by gamma
Mandelbox distance estimation problem 3D Fractal Generation « 1 2 » barkeg 23 19552 Last post August 27, 2011, 12:28:36 PM
by barkeg
Problem with Mandelbrot Distance Estimator Mandelbrot & Julia Set Levi 14 9296 Last post February 20, 2015, 04:13:13 PM
by Adam Majewski
Mandelbrot Set Distance Estimator Rendering Problem UltraFractal aleph0 5 11182 Last post April 30, 2014, 01:08:45 AM
by aleph0
Mandelbrot Distance Estimation Still Frame - Wildstyle Kalles Fraktaler 0 697 Last post June 08, 2017, 01:10:01 PM
by Kalles Fraktaler

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.175 seconds with 24 queries. (Pretty URLs adds 0.01s, 2q)