Mandelbrot/Task 2B - OpenLearning

Sabrina Rispin

sabrinar

Master Plan

Step

Completed By:

Date We Should Finish:

Date Completed:

Escape steps function (determines if a point is in the Mandelbrot set)

printMandelbrot function using above printing it out in '*'

Get simpleServer able to write the ascii mandelbrot to a web page

Get serveBMP working to make the mandelbrot a BMP image

All user input of x y position and zoom then serve that image

Color using pretty colors and pixelColor.c/.h

Get Parsing working to take in url input

Have fun looking around!

Sabrina

Sabrina

Sabrina/Nick

Sabrina/Nick

Sabrina/Nick

Sabrina

Sabrina/Nick

Sabrina/Nick

18 Apr

19 Apr

19 Apr

20 Apr

22 Apr

23 Apr

24 Apr

24/25 Apr

18 Apr

18 Apr

19 Apr

22 Apr

Completed to work with ascii mandelbrot  19 Apr

23 Apr

24 Apr

Blogs

Tut-Lab Wk 6

Sabrina - blog on escapeSteps and printMandelbrot

Nick - Weekend Teamwork

 

Final Files (Actually Completed!!!)

escapeSteps

int escapeSteps (double x, double y) {
    int escaped = FALSE;
    double zRe = 0.0;
    double zIm = 0.0;
    double newRe = 0.0;
    double newIm = 0.0;

    //printf ("Real c: %lf, Imaginary c: %lf\n", x, y);
    
    int iter = 0;
    while ((iter < MAX_ITER) && (escaped != TRUE)) {
        iter++;
        newRe = zRe*zRe - zIm*zIm + x;
        newIm = 2*zRe*zIm + y;

        zRe = newRe;
        zIm = newIm;

        if (zRe*zRe + zIm*zIm >= 4) {
            escaped = TRUE;
        }
    }

    //printf ("%d\n", iter);

    return iter;
}

printMandelbrot

static void printMandelbrot (double x, double y, int zoom) {
    double step = pow (POWER, -zoom);
    double xStart = -step*SIZE/2 + step/2 + x;
    double xPos = xStart;
    double yPos = step*SIZE/2 - step/2 + y;
    int xCount = 0;
    int yCount = 0;

    while (yCount < SIZE) {
        while (xCount < SIZE) {
            //printf("%lf, %lf\n", xPos, yPos);
            if (escapeSteps (xPos, yPos) < MAX_ITER) {
                printf ("--");
            } else {
                printf ("**");
            }
            xPos += step;  
            xCount++;  
        }
        printf ("\n");
        xPos = xStart;
        yPos -= step;
        yCount++;
        xCount = 0;
    }
}

zoom = 2

zoom = 4

zoom = 7

mandelbrot to localhost:7191

 

 

Comments

Chat