Constants tweaking

This commit is contained in:
Lucas 2020-03-09 00:28:41 +00:00
parent 6fafdf069d
commit 2c79b15008
3 changed files with 12 additions and 9 deletions

View File

@ -17,8 +17,10 @@
#include "criticals.h"
#include "util.h"
#define MAX_CRITICALS 100
static size_t idx = 0;
static long double complex criticals[100];
static long double complex criticals[MAX_CRITICALS];
int
behaves_critical(long double complex (*df)(long double complex),
@ -43,7 +45,7 @@ add_critical_point(long double complex z)
{
size_t i;
if (idx >= nelems(criticals))
if (idx >= MAX_CRITICALS)
return;
for (i = 0; i < idx; i++)
if (cabsl(z - criticals[i]) < 1.0e-9)

11
julia.c
View File

@ -31,6 +31,7 @@
#define RITNUM(c, i) (c[i].it - c[i].rit)
#define OPTSTRING "a:b:c:D:d:h:Ll:N:n:w:x:y:z:"
#define RADIAN 3.14159265358979323846L
struct color contour_color = { 0 };
static long double bailout = 1e100,
@ -133,7 +134,7 @@ julia_main(int argc, char *argv[])
zoom = 1.0,
light, light_x, light_y, light_z, rit, rn, sec_h, zx, zy;
long long it, idx, ritnum;
int palette_size = 720,
int palette_size = 1000,
width = 640,
height = 400,
rescache_width, rescache_height, i, j;
@ -157,7 +158,7 @@ julia_main(int argc, char *argv[])
density = parse_double(optarg);
break;
case 'h':
height = parse_integer(optarg, 1, 65536);
height = parse_integer(optarg, 1, INT_MAX);
break;
case 'L':
do_light = 1;
@ -172,7 +173,7 @@ julia_main(int argc, char *argv[])
niters = parse_integer(optarg, 1, LONG_MAX);
break;
case 'w':
width = parse_integer(optarg, 1, 65536);
width = parse_integer(optarg, 1, INT_MAX);
break;
case 'x':
julia_x = parse_double(optarg);
@ -202,8 +203,8 @@ julia_main(int argc, char *argv[])
if (do_light) {
long double angle_xy, angle_z;
angle_xy = drand48() * 2.0L * 3.14159265358979323846L;
angle_z = (0.2L + 0.6L * drand48()) * 3.14159265358979323846L;
angle_xy = drand48() * 2.0L * RADIAN;
angle_z = (0.2L + 0.6L * drand48()) * RADIAN;
light_x = cosl(angle_xy) * sinl(angle_z);
light_y = sinl(angle_xy) * sinl(angle_z);
light_z = cosl(angle_z);

View File

@ -85,8 +85,8 @@ palette_main(int argc, char *argv[])
struct color *palette;
int ch, i, j, width, height;
height = 100;
width = 720;
height = 50;
width = 500;
while ((ch = getopt(argc, argv, "h:w:")) != -1)
switch (ch) {
case 'h':