small changes suggested by Franz
This commit is contained in:
parent
39cc9e35ae
commit
9b0d3def1d
|
@ -83,7 +83,7 @@ class Rotation:
|
||||||
])
|
])
|
||||||
elif other.shape == (3,3,): # rotate a single (3x3)-matrix
|
elif other.shape == (3,3,): # rotate a single (3x3)-matrix
|
||||||
return np.dot(self.asMatrix(),np.dot(other,self.asMatrix().T))
|
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
|
raise NotImplementedError
|
||||||
else:
|
else:
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
|
@ -78,10 +78,8 @@ class Quaternion:
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
||||||
def __neg__(self):
|
def __neg__(self):
|
||||||
"""Unary positive operator"""
|
"""Unary negative operator"""
|
||||||
self.q *= -1.0
|
return self * -1.0
|
||||||
self.p *= -1.0
|
|
||||||
return self
|
|
||||||
|
|
||||||
|
|
||||||
def __mul__(self, other):
|
def __mul__(self, other):
|
||||||
|
@ -208,8 +206,7 @@ class Quaternion:
|
||||||
|
|
||||||
def homomorph(self):
|
def homomorph(self):
|
||||||
"""Homomorphs in-place"""
|
"""Homomorphs in-place"""
|
||||||
self.q = -self.q
|
self *= -1.0
|
||||||
self.p = -self.p
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def homomorphed(self):
|
def homomorphed(self):
|
||||||
|
|
Loading…
Reference in New Issue