diff options
-rw-r--r-- | src/relrod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/relrod.c b/src/relrod.c index c55432ec..ec8ad579 100644 --- a/src/relrod.c +++ b/src/relrod.c @@ -109,8 +109,8 @@ void get_reflections(struct image *image, UnitCell *cell) /* Next, solve the relrod equation to calculate * the excitation error */ a = 1.0; - b = 2.0*(gn - wavenumber); - c = -2.0*gn*k + g_sq; + b = 2.0*(wavenumber + gn); + c = -2.0*gn*wavenumber + g_sq; t = -0.5*(b + sign(b)*sqrt(b*b - 4.0*a*c)); s1 = t/a; s2 = c/t; |