15 bool parse_mdz_center(
const char *source,
int length, mpfr_t cx, mpfr_t cy, mpfr_t cz) {
18 char *source2 = strdup(source);
27 if (0 == strncmp(line,
"aspect ", 7)) { sa = line + 7; }
28 if (0 == strncmp(line,
"cx ", 3)) { sx = line + 3; }
29 if (0 == strncmp(line,
"cy ", 3)) { sy = line + 3; }
30 if (0 == strncmp(line,
"size ", 5)) { sz = line + 5; }
32 if (sa && sx && sy && sz) {
34 mpfr_set_prec(cz, 53);
35 mpfr_set_str(cz, sz, 10, MPFR_RNDN);
36 mpfr_div_d(cz, cz, 2 * a, MPFR_RNDN);
37 mpfr_abs(cz, cz, MPFR_RNDN);
45 mpfr_set_str(cx, sx, 10, MPFR_RNDN);
46 mpfr_set_str(cy, sy, 10, MPFR_RNDN);