aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-10-16 10:51:07 +0200
committerThomas White <taw@bitwiz.org.uk>2009-10-16 10:51:07 +0200
commit699f3fa9f21f24170dbd5d7091c1c374f4948aef (patch)
treec2015ddb08bca06ffc124d2976ab157e4e555c62 /src
parent67bf9d34e65c9f7006efe6af131947f207f2db38 (diff)
Fix relrod calculation
("k" was renamed to "wavenumber")
Diffstat (limited to 'src')
-rw-r--r--src/relrod.c4
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;