18 char *source2 = strdup(source);
23 if (0 == strncmp(line,
"corners=", 8)) {
26 int len = strlen(line);
27 char *sxmin = malloc(len); sxmin[0] = 0;
28 char *sxmax = malloc(len); sxmax[0] = 0;
29 char *symin = malloc(len); symin[0] = 0;
30 char *symax = malloc(len); symax[0] = 0;
31 s = strtok(corners,
"/");
35 s = strtok(NULL,
"/");
38 case 2: strcpy(sxmax, s);
break;
39 case 3: strcpy(symin, s);
break;
40 case 4: strcpy(symax, s);
break;
46 debug_message(
"parse_ppar: sxmin = %s ; sxmax = %s ; symin = %s ; symax = %s\n", sxmin, sxmax, symin, symax);
48 mpfr_t xmin, xmax, ymin, ymax;
51 mpfr_inits2(256, xmin, xmax, ymin, ymax, dx, dy, (mpfr_ptr) 0);
52 mpfr_set_str(xmin, sxmin, 10, MPFR_RNDN);
53 mpfr_set_str(xmax, sxmax, 10, MPFR_RNDN);
54 mpfr_set_str(ymin, symin, 10, MPFR_RNDN);
55 mpfr_set_str(ymax, symax, 10, MPFR_RNDN);
64 mpfr_sub(dx, xmax, xmin, MPFR_RNDN);
65 mpfr_sub(dy, ymax, ymin, MPFR_RNDN);
68 mpfr_div_2ui(dy, dy, 1, MPFR_RNDN);
69 mpfr_div_2ui(dx, dx, 1, MPFR_RNDN);
70 mpfr_abs(cz, dy, MPFR_RNDN);
82 mpfr_add(cy, ymin, dy, MPFR_RNDN);
85 mpfr_add(cx, xmin, dx, MPFR_RNDN);
88 mpfr_clears(xmin, xmax, ymin, ymax, dx, dy, (mpfr_ptr) 0);