[julia] make bailout and epsilon configurable

This commit is contained in:
Lucas 2020-03-16 01:56:29 +00:00
parent 022e2cf2e1
commit 26ba0330b5

17
julia.c
View File

@ -30,7 +30,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 OPTSTRING "a:B:b:c:D:d:e:h:Ll:N:n:w:x:y:z:"
#define RADIAN 3.14159265358979323846L
struct color contour_color = { 0 };
@ -105,10 +105,11 @@ iterate(long double complex z, long double complex c, long double *rit)
static void
usage(void)
{
fprintf(stderr, "Usage: %s julia [-L] [-a center_x] [-b center_y]\n"
" [-c contour] [-D displacement] [-d density] [-h height]\n"
" [-l light_intensity] [-N newton_iters] [-n iters]\n"
" [-w width] [-x julia_x] [-y julia_y] [-z zoom]\n",
fprintf(stderr, "Usage: %s julia [-L] [-a center_x] [-B bailout]\n"
" [-b center_y] [-c contour] [-D displacement] [-d density]\n"
" [-e epsilon] [-h height] [-l light_intensity]\n"
" [-N newton_iters] [-n iters] [-w width] [-x julia_x]\n"
" [-y julia_y] [-z zoom]\n",
xgetprogname());
exit(1);
}
@ -144,6 +145,9 @@ julia_main(int argc, char *argv[])
case 'a':
cen_x = parse_double(optarg);
break;
case 'B':
bailout = parse_double(optarg);
break;
case 'b':
cen_y = parse_double(optarg);
break;
@ -156,6 +160,9 @@ julia_main(int argc, char *argv[])
case 'd':
density = parse_double(optarg);
break;
case 'e':
epsilon = parse_double(optarg);
break;
case 'h':
height = parse_integer(optarg, 1, INT_MAX);
break;