From b3c3eeb2a28a2011c047551904566eeacb5df020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 26 Sep 2019 10:06:31 +0300 Subject: [PATCH] Fix derivatives in integration contours. Former-commit-id: 7575a69a82eb19126aaac9aede9f170815b6015a --- qpms/beyn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qpms/beyn.c b/qpms/beyn.c index a24a59e..bbc9f2b 100644 --- a/qpms/beyn.c +++ b/qpms/beyn.c @@ -75,7 +75,7 @@ beyn_contour_t *beyn_contour_ellipse(complex double centre, double rRe, double r double t = i*2*M_PI/n; double st = sin(t), ct = cos(t); c->z_dz[i][0] = centre + ct*rRe + I*st*rIm; - c->z_dz[i][1] = (I*rRe*st + rIm*ct) / n; + c->z_dz[i][1] = (-rRe*st + I*rIm*ct) * (2*M_PI / n); } // We hide the half-axes metadata after the discretisation points. c->z_dz[n][0] = rRe; @@ -121,7 +121,7 @@ beyn_contour_t *beyn_contour_halfellipse(complex double centre, double rRe, double t = (i+0.5)*M_PI/narc; double st = sin(t), ct = cos(t); c->z_dz[i][0] = centre + faktor*(ct*l + I*st*h); - c->z_dz[i][1] = faktor * (I*l*st + h*ct) / narc; + c->z_dz[i][1] = faktor * (-l*st + I*h*ct) * (M_PI / narc); } for(size_t i = 0; i < nline; ++i) { double t = 0.5 * (1 - (double) nline) + i; @@ -146,7 +146,7 @@ beyn_contour_t *beyn_contour_halfellipse(complex double centre, double rRe, default: QPMS_WTF; } c->z_dz[narc + i][0] = z; - c->z_dz[narc + i][1] = faktor * l / narc; + c->z_dz[narc + i][1] = faktor * l / nline; } // We hide the half-axes metadata after the discretisation points. c->z_dz[n][0] = rRe;