diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-09-05 17:49:58 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-09-05 17:49:58 +0000 |
commit | e00d6b3da60009117012f1d31dbdd7b4ed129480 (patch) | |
tree | b9d0196c86f30b9adc78473dd7b4ab4aab2f3365 /src/reflections.c | |
parent | 4ce57716fa17aac015a683e0eac2857699f5b8d5 (diff) |
Change the formulation of the rotations
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@121 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/reflections.c')
-rw-r--r-- | src/reflections.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/reflections.c b/src/reflections.c index a490364..dde8d84 100644 --- a/src/reflections.c +++ b/src/reflections.c @@ -162,26 +162,26 @@ void reflection_add_from_dp(ControlContext *ctx, double x, double y, ImageRecord psi = atan2(y, x); x_temp = k*sin(theta)*cos(psi); - y_temp = -k*sin(theta)*sin(psi); /* Minus sign to define axes as y going upwards */ - z_temp = k- k*cos(theta); + y_temp = k*sin(theta)*sin(psi); + z_temp = k - k*cos(theta); /* Apply the rotations... First: rotate image clockwise until tilt axis is aligned horizontally. */ - nx = x_temp*cos(omega) + y_temp*-sin(omega); - ny = x_temp*sin(omega) + y_temp*cos(omega); + nx = x_temp*cos(omega) + y_temp*sin(omega); + ny = -x_temp*sin(omega) + y_temp*cos(omega); nz = z_temp; /* Now, tilt about the x-axis ANTICLOCKWISE around +x, i.e. the "wrong" way. This is because the crystal is rotated in the experiment, not the Ewald sphere. */ x_temp = nx; y_temp = ny; z_temp = nz; nx = x_temp; - ny = cos(tilt)*y_temp - sin(tilt)*z_temp; - nz = -sin(tilt)*y_temp - cos(tilt)*z_temp; + ny = cos(tilt)*y_temp + sin(tilt)*z_temp; + nz = -sin(tilt)*y_temp + cos(tilt)*z_temp; /* Finally, reverse the omega rotation to restore the location of the image in 3D space */ x_temp = nx; y_temp = ny; z_temp = nz; - nx = x_temp*cos(-omega) + y_temp*-sin(-omega); - ny = x_temp*sin(-omega) + y_temp*cos(-omega); + nx = x_temp*cos(-omega) + y_temp*sin(-omega); + ny = -x_temp*sin(-omega) + y_temp*cos(-omega); nz = z_temp; reflection_add(ctx->reflectionctx, nx, ny, nz, intensity, REFLECTION_NORMAL); |