normalisation methods for quaternions - to be ported from c++