-
Notifications
You must be signed in to change notification settings - Fork 1
/
util.h
42 lines (36 loc) · 1.05 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef UTIL_H
#define UTIL_H
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif
struct Screen {
int width;
int height;
double minx;
double maxx;
double miny;
double maxy;
double centerx;
double centery;
double zoom;
int iterations;
double aspect;
int screensize;
double rangex;
double rangey;
double dx;
double dy;
};
struct Screen getScreen(int argc, char** argv);
double random(double a, double b);
void writePPM(const char *filename, const int *array, int width, int height, int max);
int tallyPath(const double *zrArray, const double *ziArray, int count, int *hist, const struct Screen s);
void mutate(double cr, double ci, double *crnew, double *cinew, double zoom);
int quickCheck(double x, double y);
void iterateMandelbrot(double *zr, double *zi, double cr, double ci);
int insideMandelbrot(double cr, double ci, int maxIter);
int getMandelbrotPath(double *zrArray, double *ziArray, double cr, double ci, int maxIter);
#endif