Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Julia set
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Pseudocode for multi-Julia sets === : <math>f(z) = z^n + c</math> <syntaxhighlight lang="perl"> R = escape radius # choose R > 0 such that R**n - R >= sqrt(cx**2 + cy**2) for each pixel (x, y) on the screen, do: { zx = scaled x coordinate of pixel; # (scale to be between -R and R) zy = scaled y coordinate of pixel; # (scale to be between -R and R) iteration = 0; max_iteration = 1000; while (zx * zx + zy * zy < R**2 AND iteration < max_iteration) { xtmp = (zx * zx + zy * zy) ^ (n / 2) * cos(n * atan2(zy, zx)) + cx; zy = (zx * zx + zy * zy) ^ (n / 2) * sin(n * atan2(zy, zx)) + cy; zx = xtmp; iteration = iteration + 1; } if (iteration == max_iteration) return black; else return iteration; } </syntaxhighlight> Another recommended option is to reduce color banding between iterations by using a renormalization formula for the iteration. <ref name="Renormalizing the Mandelbrot Escape">{{cite web |last1=Vepstas |first1=Linas |title=Renormalizing the Mandelbrot Escape |url=https://linas.org/art-gallery/escape/escape.html |website=linas.org |publisher=Creative Commons |access-date=5 November 2023 |ref=ps1}} </ref> Such formula is given to be, :<math>mu = k + 1 - \frac{\log{\log{|z_{k}|}}}{\log{n}}</math> :<math>\forall f_{c,n}(z) = z^{n} + \text{lower power terms} + c</math> where <math>k</math> is the escaping iteration, bounded by some <math>K</math> such that <math>0 \leq k < K</math> and <math> K \in \mathbb{N}</math>, and <math>|z_{k}|</math> is the magnitude of the last iterate before escaping. This can be implemented, very simply, like so: <syntaxhighlight lang="perl"> # simply replace the last 4 lines of code from the last example with these lines of code: if(iteration == max_iteration) return black; else abs_z = zx * zx + zy * zy; return iteration + 1 - log(log(abs_z))/log(n); </syntaxhighlight> The difference is shown below with a Julia set defined as <math>f_{c, 2}(z)</math> where <math> c = -0.835 - 0.321i </math>. {{Gallery |title=Julia set with color banding and without |width=320|height=144 |align=center |File:JuliasetColorband.png |With color banding |alt1=Julia set with color banding |File:JuliasetNoColorband.png |Without color banding |alt2=Julia set without color banding }}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Julia set
(section)
Add topic