Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
267 views
in Technique[技术] by (71.8m points)

fractals - Julia Set - problem with own Mathematica implementation

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

question from:https://stackoverflow.com/questions/65647967/julia-set-problem-with-own-mathematica-implementation

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...