aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-10-07 16:33:55 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:01 +0100
commit8ed37ffb1dbdaeddb557216a5c50561bda8c40ca (patch)
treec710f52b90264535d2a73fadc46b3cf95d857940 /src
parentf86e00786e843982519885049f7bb7ef2436e7fd (diff)
Transpose cell, get right units, flip z
Diffstat (limited to 'src')
-rw-r--r--src/stream.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/stream.c b/src/stream.c
index 0892379e..b56c20ce 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -75,29 +75,29 @@ static UnitCell *read_orientation_matrix(FILE *fh)
static UnitCell *read_orientation_matrix_rick(FILE *fh)
{
- float u, v, w;
+ float a, b, c;
struct rvec as, bs, cs;
UnitCell *cell;
char line[1024];
if ( fgets(line, 1023, fh) == NULL ) return NULL;
- if ( sscanf(line, "%f %f %f", &u, &v, &w) != 3 ) {
+ if ( sscanf(line, "%f %f %f", &a, &b, &c) != 3 ) {
ERROR("Couldn't read a-star\n");
return NULL;
}
- as.u = u*1e9; as.v = v*1e9; as.w = w*1e9;
+ as.u = a*1e10; bs.u = b*1e10; cs.u = c*1e10;
if ( fgets(line, 1023, fh) == NULL ) return NULL;
- if ( sscanf(line, "%f %f %f", &u, &v, &w) != 3 ) {
+ if ( sscanf(line, "%f %f %f", &a, &b, &c) != 3 ) {
ERROR("Couldn't read b-star\n");
return NULL;
}
- bs.u = u*1e9; bs.v = v*1e9; bs.w = w*1e9;
+ as.v = a*1e10; bs.v = b*1e10; cs.v = c*1e10;
if ( fgets(line, 1023, fh) == NULL ) return NULL;
- if ( sscanf(line, "%f %f %f", &u, &v, &w) != 3 ) {
+ if ( sscanf(line, "%f %f %f", &a, &b, &c) != 3 ) {
ERROR("Couldn't read c-star\n");
return NULL;
}
- cs.u = u*1e9; cs.v = v*1e9; cs.w = w*1e9;
+ as.w = -a*1e10; bs.w = -b*1e10; cs.w = -c*1e10;
cell = cell_new_from_axes(as, bs, cs);
return cell;