Finish julia
This commit is contained in:
parent
a0b4e19007
commit
8cc11ea130
6 changed files with 3 additions and 3 deletions
6
Julia.fs
6
Julia.fs
|
|
@ -8,15 +8,15 @@ let generatePixel x y height width zoom rMax maxIter =
|
||||||
let c = MandelBrot.getComplexValueForPixel (float x) (float y) (float height) (float width) zoom
|
let c = MandelBrot.getComplexValueForPixel (float x) (float y) (float height) (float width) zoom
|
||||||
let z = Complex(-0.8, 0.156)
|
let z = Complex(-0.8, 0.156)
|
||||||
|
|
||||||
let rec findI i z =
|
let rec findI i c =
|
||||||
if i >= maxIter then i
|
if i >= maxIter then i
|
||||||
else if Complex.Abs(z) >= (float rMax) then i
|
else if Complex.Abs(c) >= (float rMax) then i
|
||||||
else
|
else
|
||||||
let newRe = c.Real*c.Real - c.Imaginary*c.Imaginary
|
let newRe = c.Real*c.Real - c.Imaginary*c.Imaginary
|
||||||
let newIm = 2.0 * c.Real * c.Imaginary
|
let newIm = 2.0 * c.Real * c.Imaginary
|
||||||
findI (i+1) (Complex(newRe, newIm)+z)
|
findI (i+1) (Complex(newRe, newIm)+z)
|
||||||
|
|
||||||
MandelBrot.colorMap (findI 0 (Complex(0.0, 0.0))) maxIter
|
MandelBrot.colorMap (findI 0 c) maxIter
|
||||||
|
|
||||||
let generate (width:int) height zoom rMax maxIter =
|
let generate (width:int) height zoom rMax maxIter =
|
||||||
let result = new Bitmap(width, height)
|
let result = new Bitmap(width, height)
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
BIN
julia.bmp
BIN
julia.bmp
Binary file not shown.
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 101 KiB |
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue