Skip to content

Commit

Permalink
error in tth calculation!!! testcase missing!
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwright committed Apr 23, 2024
1 parent 88c9328 commit 6e2e4e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cdiffraction.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ void compute_geometry(double xlylzl[][3], double omega[], double omegasign,
// d is difference vector
vec3sub(xlylzl[i], o, d);
modyz = 1. / sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
// two theta
out[i][0] = DEG * atan2( sqrt( d[1]*d[1] + d[2]*d[2] ), d[0] );
// ! k-vector
ds = 1. / wvln;
k[0] = ds * (d[0] * modyz - 1.);
k[1] = ds * d[1] * modyz;
k[2] = ds * d[2] * modyz;
// two theta
out[i][0] = DEG * atan2( sqrt( k[1]*k[1] + k[2]*k[2] ), k[0] );
// eta
out[i][1] = DEG * atan2( -k[1], k[2] );
out[i][1] = DEG * atan2( -d[1], d[2] );
// dstar
out[i][2] = sqrt( k[0]*k[0] + k[1]*k[1] + k[2]*k[2] );
// g-vector
Expand Down

0 comments on commit 6e2e4e6

Please sign in to comment.