Array Programming the Mandelbrot Set

home

Years ago, when I was learning the J programming language I wrote the mandelbrot set:

load 'viewmat'

mandelbrot =. ([ + ^&2)
mandel_iter =: (|)@:(mandelbrot/\.)@:([ # ])
range =. (i.@:(1&+)@:(*&2) - ])
grid =. ({. (,"0)/ {.)@:(range "0)@:(2&#)

pixels =. (2&>)@:(25&mandel_iter)@:(-&0.5)@:j./@:(0.01&*) L:0 <"1 grid 100

viewmat > +/ L:0 pixels

As is often the case with array programming, I revisited this last week only to realize I couldn’t read it. I considered revisiting it to brush up on J, but in more recent times I’ve been doing my array programming in Uiua. While I’m also rusty at Uiua these days, I thought that a translation would be a more i…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help