What am about to show you is one of the most remarkable mathematical images ever discovered. Epic doesn't really do it justice.This is the Mandelbrot set.It's been called the thumbprint of god.And we begin to explore it to understand why.
曼德勃罗特集(Mandelbrot set)是人类有史以来做出的最奇异,最瑰丽的几何图形,曾被称为“上帝的指纹”。 这个点集均出自公式:
将C变量固定,可以得到另一个浪漫的分形-Julia集
曼德勃罗特集是易并行计算的经典例子,在本文中使用Java并行库实现了一个曼德勃罗特集
核心代码很简单:
// 将真实坐标映射到复平面坐标x = mbrot.xCenter + (xOffset + c)
/ (mbrot.resolution);
y = mbrot.yCenter + (yOffset - r - mbrot.hOffset)
/ (mbrot.resolution);
//这些变量用于迭代iteration = 0;
a = x;
b = y;
// 迭代指定次数,当迭代的模长超出指定范围视为发散while (a * a + b * b <= divergence && iteration < maxIterations) {
// Calculate the sequence aOld = a;
//计算Mandbrot集,c值为当前迭代的坐标,是变量// a = a * a - b * b + x;// b = 2 * aOld * b + y; //计算Julia集,c值为固定值,这里为0.73i,是常量 a = a * a - b * b ;
b = 2 * aOld * b + 0.73;
iterati