ls,
I'm preparing a course on GPU programming (NVIDIA's parallel graphics
processor) for bachelor students using J. I have a need for a more
tacit form of a julia fractal than the one shown below, which is too
much C-like. Suggestions are welcomed.
Thanks in advance,
Jan.


load'graph'
DIM=:400

NB. Julia function
julia=:4 : 0
        scale=.1.5
        jx=.scale*((-:DIM)-x)%-:DIM
        jy=.scale*((-:DIM)-y)%-:DIM
        c=._0.8j0.156
        a=.jx j. jy
        i=.0
        while. i < 256 do.
                a=.(a * a) + c
                if. 1000 < | a do. i return. end.
                i=.i + 1
        end.
        255
)

viewmat (i.DIM)julia"0 0/ (i.DIM)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to