diff options
author | Thomas White <taw27@cam.ac.uk> | 2008-10-15 17:14:47 +0100 |
---|---|---|
committer | Thomas White <taw27@cam.ac.uk> | 2008-10-15 17:14:47 +0100 |
commit | 0875545e5d030661fc5e409a190b32b39c9e46c2 (patch) | |
tree | b2f0ca6615eaadd962b88341f56bfea75458d993 | |
parent | 53bc9f5e57d5757cbe327a85294197a23b1116af (diff) |
Use mapping_rotate to get 'up' direction
-rw-r--r-- | src/reproject.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/reproject.c b/src/reproject.c index 3bfc20a..e008944 100644 --- a/src/reproject.c +++ b/src/reproject.c @@ -18,6 +18,7 @@ #include "imagedisplay.h" #include "displaywindow.h" #include "image.h" +#include "mapping.h" /* Attempt to find partners from the feature list of "image" for each feature in "flist". */ void reproject_partner_features(ImageFeatureList *rflist, ImageRecord *image) { @@ -53,7 +54,7 @@ ImageFeatureList *reproject_get_reflections(ImageRecord *image, ReflectionList * double tilt, omega; double nx, ny, nz, nxt, nyt, nzt; /* "normal" vector (and calculation intermediates) */ double kx, ky, kz; /* Electron wavevector ("normal" times 1/lambda */ - double ux, uy, uz, uxt, uyt, uzt; /* "up" vector (and calculation intermediates) */ + double ux, uy, uz; /* "up" vector */ int done_debug = 0; int i = 0; @@ -75,10 +76,7 @@ ImageFeatureList *reproject_get_reflections(ImageRecord *image, ReflectionList * /* Determine where "up" is * See above. */ - uxt = 0.0; uyt = 1.0; uzt = 0.0; - ux = uxt; uy = cos(tilt)*uyt + sin(tilt)*uzt; uz = -sin(tilt)*uyt + cos(tilt)*uzt; - uxt = ux; uyt = uy; uzt = uz; - ux = uxt*cos(-omega) + uyt*-sin(omega); uy = -uxt*sin(omega) + uyt*cos(omega); uz = uzt; + mapping_rotate(0.0, 1.0, 0.0, &ux, &uy, &uz, omega, tilt); reflection_add(ctx->reflectionlist, ux*50e9, uy*50e9, uz*50e9, 1, REFLECTION_VECTOR_MARKER_2); reflection = reflectionlist->reflections; |