bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Standard way to compute a Mandelbrot fractal in APL


From: Elias Mårtenson
Subject: Standard way to compute a Mandelbrot fractal in APL
Date: Mon, 21 Sep 2020 13:17:18 +0800

What is the neatest way to compute a Mandelbrot fractal in APL? The fact that you have to break out of the loop as soon as the absolute value of Z is >2 makes it a bit ugly. Is there a neater way to do this?

This is what I came up with that works in GNU APL:

" #"[⌊0.5+50÷⍨ { (n ⊣ {(x+⍵×⍵) ⊣ n←n+1}⍣{(2<|⍺) ∨ n≥50} n←0) ⊣ x←⍵ }¨ (0J1×r) ∘.+ r←¯2+25÷⍨⍳100]

Any suggestions for improvements?

Regards,
Elias

reply via email to

[Prev in Thread] Current Thread [Next in Thread]