Skip to content

Commit

Permalink
Change default initialization for Quaternions to 1 + 0i + 0j + 0k
Browse files Browse the repository at this point in the history
The current initialization is not representing a pure rotation as it is not
normalized. Change this to the identity quaternion 1 + 0i + 0j + 0k, i.e.,
Q(w = 1, x = 0, y = 0, z = 0), to be consistent with the needs of the
Molecule interface.

Note: Initialisation to Q(0,0,0,0) might show some performance improvement
over Q(1,0,0,0) but tests showed neglectable influence on the overall
performance of ls1. So we stay with the safe and convenient solution.

Signed-off-by: Christoph Niethammer <[email protected]>
  • Loading branch information
cniethammer committed Dec 19, 2024
1 parent 9c6d0a2 commit 0a02250
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/molecules/Quaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
class Quaternion {
public:
Quaternion(double qw = 1., double qx = 1., double qy = 0., double qz = 0.)
Quaternion(double qw = 1., double qx = 0., double qy = 0., double qz = 0.)
: m_qw(qw), m_qx(qx), m_qy(qy), m_qz(qz) {
}

Expand Down

0 comments on commit 0a02250

Please sign in to comment.