proper definition of homomorph
This commit is contained in:
parent
1904ac211e
commit
c4f56703a4
|
@ -61,7 +61,9 @@ class Rotation:
|
|||
Rotation: Details needed (active/passive), rotation of (3,3,3,3)-matrix should be considered
|
||||
"""
|
||||
if isinstance(other, Rotation): # rotate a rotation
|
||||
return self.__class__((self.quaternion * other.quaternion).homomorph())
|
||||
qu = self.quaternion * other.quaternion
|
||||
if qu.q < 0: qu.homomorph()
|
||||
return self.__class__(qu)
|
||||
elif isinstance(other, np.ndarray):
|
||||
if other.shape == (3,): # rotate a single (3)-vector
|
||||
( x, y, z) = self.quaternion.p
|
||||
|
|
|
@ -201,9 +201,8 @@ class Quaternion:
|
|||
|
||||
|
||||
def homomorph(self):
|
||||
if self.q < 0.0:
|
||||
self.q = -self.q
|
||||
self.p = -self.p
|
||||
self.q = -self.q
|
||||
self.p = -self.p
|
||||
return self
|
||||
|
||||
def homomorphed(self):
|
||||
|
|
Loading…
Reference in New Issue