1

I've been working on my own Julia Set Plot Implementation. I don't want to use JuliaSetPlot, (however I'm eager to use JuliaSetIterationPoints and JuliaSetCount, I just don't really know how).

I've come up with something like this, but I have a problem, I have no idea what is wrong and why it won't work.

Can anyone help?

'''mathematica

firstFun= Function[ {Typed[pixel0, "ComplexReal64"]},
    Module[{i = 1, maksi=100, pixel = pixel0},
    While[i < maksi && (Abs[pixel])^2 < 2,
    temp = (Re[pixel])^2 - (Im[pixel])^2
    Re[pixel] = 2 * Re[pixel] * Im[pixel] - 0.8\[Iota] * Im[pixel0]
    Im[pixel] = temp - 0.8\[Iota]* Re[pixel0];
     i++ ];
    i]];  

''' my code

  • Please [edit] your question to include the full source code you have as a [mcve], which can be tested by others. Do not post a screenshot of the source code. – Progman Jan 10 '21 at 19:23

1 Answers1

0

This

firstFun=Function[{Typed[pixel0,"ComplexReal64"]},
  Module[{i=1,maksi=100,pixel=pixel0},
    While[i<maksi&&Abs[pixel]^2<2,
      pixel=2*Re[pixel]*Im[pixel]-0.8*I*Im[pixel0]+
       I*(Re[pixel]^2-Im[pixel]^2-0.8*I*Re[pixel0]);
      i++];
    i]];
compFun[c_]=FunctionCompile[firstFun]

compiles without any compile-time error messages.

If I haven't made a mistake then I think your pixel calculation can be simplified to

pixel=I*Conjugate[pixel]^2+0.8*Conjugate[pixel0]

Please test all this very carefully to make certain that it is correct.

Bill
  • 3,664
  • 1
  • 12
  • 9