diff options
author | Thomas White <taw@physics.org> | 2010-11-15 16:17:02 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:05 +0100 |
commit | 1b4fa114decd9c36324feed00296cb40088a9062 (patch) | |
tree | 2d313458c29c6f4ac5de5513639020558eaaa556 /src/cell.c | |
parent | fcde5d4f2fd95845402b86c3838f15b6632a8071 (diff) |
Zap quats
The "orientation" quaternion should not rotate the Ewald sphere, but the crystal.
This cleans things up a little, removing "orientation" from "struct image".
Diffstat (limited to 'src/cell.c')
-rw-r--r-- | src/cell.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -486,6 +486,28 @@ static const char *cell_rep(UnitCell *cell) } +UnitCell *cell_rotate(UnitCell *in, struct quaternion quat) +{ + struct rvec a, b, c; + struct rvec an, bn, cn; + UnitCell *out = cell_new(); + + cell_get_cartesian(in, &a.u, &a.v, &a.w, + &b.u, &b.v, &b.w, + &c.u, &c.v, &c.w); + + an = quat_rot(a, quat); + bn = quat_rot(b, quat); + cn = quat_rot(c, quat); + + cell_set_cartesian(out, an.u, an.v, an.w, + bn.u, bn.v, bn.w, + cn.u, cn.v, cn.w); + + return out; +} + + void cell_print(UnitCell *cell) { double asx, asy, asz; |