Skip to content

Commit

Permalink
Mandelbrot: More coding style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
waddlesplash committed Jun 18, 2016
1 parent 5322a6d commit b92f800
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/apps/mandelbrot/FractalEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int32 FractalEngine::DoSet_Mandelbrot(double real, double imaginary)
for (int32 i = 0; i < fIterations; i++) {
double zRealSq = zReal * zReal;
double zImaginarySq = zImaginary * zImaginary;
double nzReal = (zRealSq + (-1 * (zImaginarySq)));
double nzReal = (zRealSq + (-1 * zImaginarySq));

zImaginary = 2 * (zReal * zImaginary);
zReal = nzReal;
Expand All @@ -143,7 +143,7 @@ int32 FractalEngine::DoSet_Mandelbrot(double real, double imaginary)
zImaginary += imaginary;

// If it is outside the 2 unit circle...
if ((zRealSq) + (zImaginarySq) > gEscapeHorizon) {
if ((zRealSq + zImaginarySq) > gEscapeHorizon) {
return i; // stop it from running longer
}
}
Expand All @@ -165,7 +165,7 @@ int32 FractalEngine::DoSet_BurningShip(double real, double imaginary)

double zRealSq = zReal * zReal;
double zImaginarySq = zImaginary * zImaginary;
double nzReal = (zRealSq + (-1 * (zImaginarySq)));
double nzReal = (zRealSq + (-1 * zImaginarySq));

zImaginary = 2 * (zReal * zImaginary);
zReal = nzReal;
Expand All @@ -174,7 +174,7 @@ int32 FractalEngine::DoSet_BurningShip(double real, double imaginary)
zImaginary += imaginary;

// If it is outside the 2 unit circle...
if ((zRealSq) + (zImaginarySq) > gEscapeHorizon) {
if ((zRealSq + zImaginarySq) > gEscapeHorizon) {
return i; // stop it from running longer
}
}
Expand All @@ -196,7 +196,7 @@ int32 FractalEngine::DoSet_Tricorn(double real, double imaginary)

double zRealSq = zReal * zReal;
double zImaginarySq = zImaginary * zImaginary;
double nzReal = (zRealSq + (-1 * (zImaginarySq)));
double nzReal = (zRealSq + (-1 * zImaginarySq));

zImaginary = 2 * (zReal * zImaginary);
zReal = nzReal;
Expand All @@ -205,7 +205,7 @@ int32 FractalEngine::DoSet_Tricorn(double real, double imaginary)
zImaginary += imaginary;

// If it is outside the 2 unit circle...
if ((zRealSq) + (zImaginarySq) > gEscapeHorizon) {
if ((zRealSq + zImaginarySq) > gEscapeHorizon) {
return i; // stop it from running longer
}
}
Expand Down Expand Up @@ -233,7 +233,7 @@ int32 FractalEngine::DoSet_Julia(double real, double imaginary)
zImaginary += muIm;

// If it is outside the 2 unit circle...
if ((zRealSq) + (zImaginarySq) > gEscapeHorizon) {
if ((zRealSq + zImaginarySq) > gEscapeHorizon) {
return i; // stop it from running longer
}
}
Expand All @@ -253,16 +253,16 @@ int32 FractalEngine::DoSet_OrbitTrap(double real, double imaginary)
for (int32 i = 0; i < fIterations; i++) {
double zRealSq = zReal * zReal;
double zImaginarySq = zImaginary * zImaginary;
double nzReal = (zRealSq + (-1 * (zImaginarySq)));
double nzReal = (zRealSq + (-1 * zImaginarySq));

zImaginary = 2 * (zReal * zImaginary);
zReal = nzReal;

zReal += real;
zImaginary += imaginary;

distance = sqrt((zRealSq) + (zImaginarySq));
lineDist = fabs((zReal) + (zImaginary));
distance = sqrt(zRealSq + zImaginarySq);
lineDist = fabs(zReal + zImaginary);

// If it is closer than ever before...
if (lineDist < closest)
Expand All @@ -284,16 +284,16 @@ int32 FractalEngine::DoSet_Multibrot(double real, double imaginary)
for (int32 i = 0; i < fIterations; i++) {
double zRealSq = zReal * zReal;
double zImaginarySq = zImaginary * zImaginary;
double nzReal = (zRealSq * zReal - 3 * zReal * (zImaginarySq));
double nzReal = (zRealSq * zReal - 3 * zReal * zImaginarySq);

zImaginary = 3 * ((zRealSq)*zImaginary) - (zImaginarySq * zImaginary);
zImaginary = 3 * (zRealSq * zImaginary) - (zImaginarySq * zImaginary);

zReal = nzReal;
zReal += real;
zImaginary += imaginary;

// If it is outside the 2 unit circle...
if ((zRealSq) + (zImaginarySq) > gEscapeHorizon) {
if ((zRealSq + zImaginarySq) > gEscapeHorizon) {
return i; // stop it from running longer
}
}
Expand Down

0 comments on commit b92f800

Please sign in to comment.