周末,除了呆在宿舍在网上给阿bou找一个婴儿床和给nico看一个手机以外,我总要折腾点什么嘛。于是...
Mandelbrot set, on the complex plane (two axis, one is the real number line, the other is the imagary number line), at a region from -2 - 1i to 1 + 1i, given a point (x + yi), is this point inside this set or outside this set? For points outsidet this region, they are defintely outside the Mandelbrot set.
The problem is that we can tell a point is outside the set only after some number iteration if magnitude(z) > 2, for a point inside the set after some iteration, it might become outside after another iteration times. So only after infinite number we can truly tell whether this point is inside or outside, otherwise we are only approximate the Manelbrot set.
Reference:
Vedio, http://www.fractalforums.com/fractal-related-links/the-mandelbrot-set
The Mandelbrot Set: Colors of Infinity, from oZone3D.
Mandelbrot set, on the complex plane (two axis, one is the real number line, the other is the imagary number line), at a region from -2 - 1i to 1 + 1i, given a point (x + yi), is this point inside this set or outside this set? For points outsidet this region, they are defintely outside the Mandelbrot set.
The problem is that we can tell a point is outside the set only after some number iteration if magnitude(z) > 2, for a point inside the set after some iteration, it might become outside after another iteration times. So only after infinite number we can truly tell whether this point is inside or outside, otherwise we are only approximate the Manelbrot set.
void main()
{
vec2 c = p;// pixel position.
vec2 z = c;
outputColor = insideColor;
for (int i = 0; i < maxIterations; ++i)
{
// z = z^2 + c.
z = vec2(z.x * z.x - z.y * z.y, 2 * z.x * z.y) + c;
if (dot(z, z) > 4)
{
// this point is outside the set,
// decorate this point according to the iteration.
outputColor = func(i);
}
}
}
Given an initial value, to calc a sequence of values based on a formula. This is so called iterated function system.Reference:
Vedio, http://www.fractalforums.com/fractal-related-links/the-mandelbrot-set
The Mandelbrot Set: Colors of Infinity, from oZone3D.


