我有一个 Mandelbrot 集合生成器:
private int calculateMandel(double positionX, double positionY) {
int valueOne = 0;
double complexReal = 0.0;
double complexImaginery = 0.0;
double complexRealSquare = 0.0;
double complexImaginerySquare = 0.0;
while (valueOne < MAX && complexRealSquare + complexImaginerySquare < 4.0) {
complexImaginery = 2.0 * complexReal * complexImaginery + positionY;
complexReal = complexRealSquare - complexImaginerySquare + positionX;
complexRealSquare = complexReal * complexReal;
complexImaginerySquare = complexImaginery * complexImaginery;
valueOne++;
}
return valueOne;
}
在开始修改complexReal
andcomplexImaginery
到某些值之后,不知何故我无法将 Julia 设置为这些值。我究竟做错了什么?在预定义的特定点生成 Julia 集的正确算法是什么?