Calculates mandelbrot fractal values with doubles (very fast in C# with some optimizations).
Should be called in parallel. Obviously keeping the maxIterations low yields in the fastest
results, but the fractals become more interesting and zoom-able if high values are used.
View code on GitHub
Inheritance Hierarchy
FractalZoomer Fractal
Namespace: FractalZoomer
Assembly: FractalZoomer (in FractalZoomer.exe) Version: 1.1.1.0 (1.1.1)
Syntax
The Fractal type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | Fractal | Initializes a new instance of the Fractal class |
Methods
Name | Description | |
---|---|---|
![]() | GetColorIndexFromIterationsNeeded |
Remarks
Examples
[Test] public void AnythingOutsideTheRadiusTwoHasNoIterations() { Assert.AreEqual(0, fractal.GetColorIndexFromIterationsNeeded(3, 0)); Assert.AreEqual(0, fractal.GetColorIndexFromIterationsNeeded(-2, 0)); Assert.AreEqual(0, fractal.GetColorIndexFromIterationsNeeded(0, 2)); Assert.AreEqual(0, fractal.GetColorIndexFromIterationsNeeded(0, -100)); }
[Test] public void MostNumbersCloseToTheRadiusOfTwoHaveLowValues() { Assert.AreEqual(7, fractal.GetColorIndexFromIterationsNeeded(1.977371f, 0.3f)); Assert.AreEqual(28, fractal.GetColorIndexFromIterationsNeeded(-1.8f, 0.7f)); Assert.AreEqual(11, fractal.GetColorIndexFromIterationsNeeded(0, 1.9f)); Assert.AreEqual(17, fractal.GetColorIndexFromIterationsNeeded(0, -1.7f)); Assert.AreEqual(19, fractal.GetColorIndexFromIterationsNeeded(-1.54f, 1.2f)); Assert.AreEqual(24, fractal.GetColorIndexFromIterationsNeeded(-1.4f, -1.1f)); Assert.AreEqual(17, fractal.GetColorIndexFromIterationsNeeded(1f, 1f)); }
[Test] public void SomeNumbersInsideTheRadiusHaveHigherValues() { Assert.AreEqual(37, fractal.GetColorIndexFromIterationsNeeded(-1f, 1f)); Assert.AreEqual(32, fractal.GetColorIndexFromIterationsNeeded(0.9f, 0.0f)); }
See Also