iter = 150
'number of iterations of a selected coordinate, more
makes for more detail
xorg = 0.1 'starting x coordinate on the Cartesian
plane (the Real portion)
yorg = 0.5608 'starting y coordinate on the
Cartesian plane (the Imaginary portion)
x = xorg
y = yorg
'inc=how far we will step the x and y coords each time
'you can see that this is a pretty fine stepping
increment, just covering a very small area
inc = 0.000000001
'kx and ky are constants added to the result of each
iteration calculation
kx = -0.745
ky = 0.15
'xp and yp are
screen coordinates, assuming 600 X 400 display
For xp = 1 To 600 Step 0.5
x = x + inc
xs = x
y = yorg
ys = y
For yp = 1 To 400 Step 0.5
For i = 1 To iter
'with xx being the real part and yy
being the imaginary part of the complex
'number -- we are squaring the complex
number and adding the Julia
'constants after each iteration
xx = x * x - y * y
yy = 2 * x * y
x = xx + kx
y = yy + ky
'this is the "jump out" limit, if the
result diverges
If Abs(x) > 2500000 Or Abs(y) > 2500000 Then i = iter
Next
'figure the colors to plot, based on how big
the iterative calculation got
If xx <> 0 Then nc = Log(Abs(xx) ^ 14)
cc = Abs(nc)
If yy <> 0 Then nc = Log(Abs(yy) ^ 8)
cd = Abs(nc)
If xx <> 0 And yy <> 0 Then nc = Log(Abs(xx * yy) ^ 2)
ce = Abs(nc)
If cc > 256 Then cc = 256
If cd > 256 Then cd = 256
If ce > 256 Then ce = 256
'plot the point (this PSET plot function is
given here in VB format)
Picture1.PSet (xp, yp), RGB(cc, cd, ce)
'step the complex coordinate and do it for
the next screen point
ys = ys + inc
y = ys
x = xs
Next
Next