bugfix: wrong variable

This commit is contained in:
Martin Diehl 2020-05-16 09:40:32 +02:00
parent 2dc46b783a
commit e2ba294b75
1 changed files with 3 additions and 3 deletions

View File

@ -131,12 +131,12 @@ class Rotation:
details to be discussed
"""
if isinstance(other, Rotation): # rotate a rotation
q_m = self.quaternion[...,0].reshape(self.shape+(1,))
q_m = self.quaternion[...,0:1]
p_m = self.quaternion[...,1:]
q_o = other.quaternion[...,0].reshape(self.shape+(1,))
q_o = other.quaternion[...,0:1]
p_o = other.quaternion[...,1:]
q = (q_m*q_o - np.einsum('...i,...i',p_m,p_o).reshape(self.shape+(1,)))
p = q_m*p_m + q_o*p_m + _P * np.cross(p_m,p_o)
p = q_m*p_o + q_o*p_m + _P * np.cross(p_m,p_o)
return self.__class__(np.block([q,p])).standardize()
elif isinstance(other,np.ndarray):