small changes suggested by Franz

This commit is contained in:
Martin Diehl 2019-05-05 22:35:12 +02:00
parent 39cc9e35ae
commit 9b0d3def1d
2 changed files with 4 additions and 7 deletions

View File

@ -83,7 +83,7 @@ class Rotation:
])
elif other.shape == (3,3,): # rotate a single (3x3)-matrix
return np.dot(self.asMatrix(),np.dot(other,self.asMatrix().T))
elif other.shape == (3,3,3,3):
elif other.shape == (3,3,3,3,):
raise NotImplementedError
else:
return NotImplemented

View File

@ -78,10 +78,8 @@ class Quaternion:
return NotImplemented
def __neg__(self):
"""Unary positive operator"""
self.q *= -1.0
self.p *= -1.0
return self
"""Unary negative operator"""
return self * -1.0
def __mul__(self, other):
@ -208,8 +206,7 @@ class Quaternion:
def homomorph(self):
"""Homomorphs in-place"""
self.q = -self.q
self.p = -self.p
self *= -1.0
return self
def homomorphed(self):