-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
64 lines (49 loc) · 1.9 KB
/
Copy pathProgram.cs
File metadata and controls
64 lines (49 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using SixLabors.ImageSharp.PixelFormats;
/*
Created by Carlos Sánchez López
Sources:
- pgm/ppm/pbm formats:
http://en.wikipedia.org/wiki/Netpbm_format
- bmp format
http://en.wikipedia.org/wiki/BMP_file_format
- matlab colormap:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colormap.html
- Mandelbrot set, programming, coloring and smoothing
http://en.wikipedia.org/wiki/Mandelbrot_set
- Smooth shading for the Mandelbrot exterior
http://linas.org/art-gallery/escape/smooth.html
- Coloring the Mandelbrot set
http://yozh.org/mset_index/
- Mandelbulb (3D Mandelbrot)
http://www.skytopia.com/project/fractal/mandelbulb.html
- Fast BMPs in C#:
https://www.codeproject.com/Tips/240428/Work-with-bitmap-faster-with-Csharp
fraction: number between {0,1}
the bigger the radius, the farther fraction is from 0
k: number between 0 and iterations
k+1-fraccion: minvalue=0, maxvalue=11
colors_palette/(iterations+1): minvalue=1, maxvalue=colors_palette
everything: minvalue=0, maxvalue=11*colors_palette
*/
namespace FractalGenerator;
public class Program
{
public static void Main(string[] args)
{
Log.Success("-------------------------");
Log.Success("--- FRACTAL GENERATOR ---");
Log.Success("-------------------------");
Configuration.Verify(args);
Fractal fractal = Configuration.FractalVariation switch
{
FractalVariations.Julia => new Julia(),
FractalVariations.Mandelbrot => new Mandelbrot(),
FractalVariations.Newton => new Newton(),
FractalVariations.Spiderweb => new Spiderweb(),
_ => throw new ArgumentException($"Unknown fractal variation: {Configuration.FractalVariation}"),
};
fractal.Generate();
fractal.Open();
}
}