0
저는 아직 Java에 비교적 익숙하지 않습니다. 나는 mandelbrot 세트를 표시하는 프로그램을 작업 해왔다. 내 현재 코드를 닫습니다 있지만 mandelbrot 꽤 설정되지 이미지를 생성합니다. 이것은 제 세대 코드입니다 :Java에서 Mandelbrot을 올바르게 설정하지 않았습니다.
private void generateMap() {
// scale, ITERATIONS, map, and SIZE are class variables
// cR and cI are the actual coordinates in the set being used
double cR = -2*scale;
double cI = -2*scale;
// a and b step through the array used to store the drawing
// and control when the loop exits
for (int a = 0; a < SIZE.width; a++)
{
for (int b = 0; b < SIZE.height; b++)
{
double xR = 0;
double xI = 0;
int iter = 0;
while (iter < ITERATIONS)
{
xR = (xR*xR-xI*xI) + cR;
xI = (2*xR*xI) + cI;
if (xR*xR+xI*xI > 4) {
map[a][b] = iter;
iter = ITERATIONS;
}
iter++;
}
cI += INCREMENT*scale;
}
cI = -2*scale;
cR += INCREMENT*scale;
}
}
내 netbeans 프로젝트는 here에서 다운로드 할 수 있습니다.
하지 문제,하지만 while 루프가 다시 작성할 수 있습니다 :'에 대한 (INT ITER = 0; ITER 4) {map [a] [b] = iter; 단절; }}' –
assylias
더 나은 도움을 받으려면 [SSCCE] (http://sscce.org/) 및 현재 및 예상 출력 이미지 링크를 게시하십시오. –