Constants tweaking
This commit is contained in:
parent
6fafdf069d
commit
2c79b15008
@ -17,8 +17,10 @@
|
|||||||
#include "criticals.h"
|
#include "criticals.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
#define MAX_CRITICALS 100
|
||||||
|
|
||||||
static size_t idx = 0;
|
static size_t idx = 0;
|
||||||
static long double complex criticals[100];
|
static long double complex criticals[MAX_CRITICALS];
|
||||||
|
|
||||||
int
|
int
|
||||||
behaves_critical(long double complex (*df)(long double complex),
|
behaves_critical(long double complex (*df)(long double complex),
|
||||||
@ -43,7 +45,7 @@ add_critical_point(long double complex z)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (idx >= nelems(criticals))
|
if (idx >= MAX_CRITICALS)
|
||||||
return;
|
return;
|
||||||
for (i = 0; i < idx; i++)
|
for (i = 0; i < idx; i++)
|
||||||
if (cabsl(z - criticals[i]) < 1.0e-9)
|
if (cabsl(z - criticals[i]) < 1.0e-9)
|
||||||
|
11
julia.c
11
julia.c
@ -31,6 +31,7 @@
|
|||||||
#define RITNUM(c, i) (c[i].it - c[i].rit)
|
#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 OPTSTRING "a:b:c:D:d:h:Ll:N:n:w:x:y:z:"
|
||||||
|
#define RADIAN 3.14159265358979323846L
|
||||||
|
|
||||||
struct color contour_color = { 0 };
|
struct color contour_color = { 0 };
|
||||||
static long double bailout = 1e100,
|
static long double bailout = 1e100,
|
||||||
@ -133,7 +134,7 @@ julia_main(int argc, char *argv[])
|
|||||||
zoom = 1.0,
|
zoom = 1.0,
|
||||||
light, light_x, light_y, light_z, rit, rn, sec_h, zx, zy;
|
light, light_x, light_y, light_z, rit, rn, sec_h, zx, zy;
|
||||||
long long it, idx, ritnum;
|
long long it, idx, ritnum;
|
||||||
int palette_size = 720,
|
int palette_size = 1000,
|
||||||
width = 640,
|
width = 640,
|
||||||
height = 400,
|
height = 400,
|
||||||
rescache_width, rescache_height, i, j;
|
rescache_width, rescache_height, i, j;
|
||||||
@ -157,7 +158,7 @@ julia_main(int argc, char *argv[])
|
|||||||
density = parse_double(optarg);
|
density = parse_double(optarg);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
height = parse_integer(optarg, 1, 65536);
|
height = parse_integer(optarg, 1, INT_MAX);
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
do_light = 1;
|
do_light = 1;
|
||||||
@ -172,7 +173,7 @@ julia_main(int argc, char *argv[])
|
|||||||
niters = parse_integer(optarg, 1, LONG_MAX);
|
niters = parse_integer(optarg, 1, LONG_MAX);
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
width = parse_integer(optarg, 1, 65536);
|
width = parse_integer(optarg, 1, INT_MAX);
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
julia_x = parse_double(optarg);
|
julia_x = parse_double(optarg);
|
||||||
@ -202,8 +203,8 @@ julia_main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (do_light) {
|
if (do_light) {
|
||||||
long double angle_xy, angle_z;
|
long double angle_xy, angle_z;
|
||||||
angle_xy = drand48() * 2.0L * 3.14159265358979323846L;
|
angle_xy = drand48() * 2.0L * RADIAN;
|
||||||
angle_z = (0.2L + 0.6L * drand48()) * 3.14159265358979323846L;
|
angle_z = (0.2L + 0.6L * drand48()) * RADIAN;
|
||||||
light_x = cosl(angle_xy) * sinl(angle_z);
|
light_x = cosl(angle_xy) * sinl(angle_z);
|
||||||
light_y = sinl(angle_xy) * sinl(angle_z);
|
light_y = sinl(angle_xy) * sinl(angle_z);
|
||||||
light_z = cosl(angle_z);
|
light_z = cosl(angle_z);
|
||||||
|
@ -85,8 +85,8 @@ palette_main(int argc, char *argv[])
|
|||||||
struct color *palette;
|
struct color *palette;
|
||||||
int ch, i, j, width, height;
|
int ch, i, j, width, height;
|
||||||
|
|
||||||
height = 100;
|
height = 50;
|
||||||
width = 720;
|
width = 500;
|
||||||
while ((ch = getopt(argc, argv, "h:w:")) != -1)
|
while ((ch = getopt(argc, argv, "h:w:")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'h':
|
case 'h':
|
||||||
|
Loading…
Reference in New Issue
Block a user