[Jprogramming] feedback wanted for mandelbrowse tutorial
David Lambert
b49p23tivg at gmail.com
Sun Jan 3 12:49:16 UTC 2016
The program works and is fairly easy to read with the caveats that I had
to read the source to guess for the name of the main verb, and
experiment to find that mbrowse's arguments are ignored.
The "smoothing out after a few zoom steps" issue is caused by too few
iterations rather than insufficient floating point precision. I change
the right mouse button code to double ITERS. Since mbrot is implicit it
needs to be recreated after changing ITERS. Elsewhere mbrot appears in
explicit code where j reevaluates the definition of mbrot. Under the
new scenario zoom in with "left mouse", hit the "right mouse", then hit
the "left mouse".
w_g_mbrup =: 3 : 0 NB. right mouse button
ITERS =: +: ITERS
mbrot =: [: +/ 2 <&| ((+ *:) :: _:)"0^:(<ITERS) & 0
CENTER =: {. CENTERS
if. (# CENTERS) > 1 do. CENTERS =: }. CENTERS end.
repaint [ SCALE =: +: SCALE
)
> Date: Sat, 2 Jan 2016 20:11:45 -0600
> From: Michal Wallace<michal.wallace at gmail.com>
> To:programming at jsoftware.com
> Subject: [Jprogramming] feedback wanted for mandelbrowse tutorial
> Message-ID:
> <CAE6HCjnPcR33AZpxX9zVn7m0KisPf743QWZFFmCwbkBYF2iTUQ at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hey all. Happy new year!
>
> I made a small GUI app for a tutorial video I'm planning:
>
> https://github.com/tangentstorm/mandelbrowse
>
> It draws the mandelbrot set, and lets you zoom in and out.
>
> I was hoping I could get some feedback on the code before I filmed anything.
>
> In particular, you can only zoom in a few steps before the edge starts
> smoothing out.
> I think the problem has to do with lack of precision in J's complex number
> type.
> Is there anything I can do about this, other than implementing my own
> complex
> number type as a pair of extended precision numbers?
>
> Thanks!
>
> -Michal
More information about the Programming
mailing list