bugfix: copy and paste error
This commit is contained in:
parent
347e3b8c60
commit
235f3c0df7
|
@ -52,7 +52,7 @@ class Rotation:
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
quaternion : numpy.ndarray, optional
|
quaternion : numpy.ndarray, optional
|
||||||
Unit quaternion that follows the conventions. Use .fromQuaternion to perform a sanity check.
|
Unit quaternion that follows the conventions. Use .from_quaternion to perform a sanity check.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.quaternion = quaternion.copy()
|
self.quaternion = quaternion.copy()
|
||||||
|
@ -144,7 +144,7 @@ class Rotation:
|
||||||
q_m = self.quaternion[...,0]
|
q_m = self.quaternion[...,0]
|
||||||
p_m = self.quaternion[...,1:]
|
p_m = self.quaternion[...,1:]
|
||||||
A = q_m**2.0 - np.einsum('...i,...i',p_m,p_m)
|
A = q_m**2.0 - np.einsum('...i,...i',p_m,p_m)
|
||||||
B = 2.0 * np.einsum('...i,...i',p_m,p_m)
|
B = 2.0 * np.einsum('...i,...i',p_m,other)
|
||||||
C = 2.0 * _P * q_m
|
C = 2.0 * _P * q_m
|
||||||
return np.block([(A * other[...,i]).reshape(self.shape+(1,)) +
|
return np.block([(A * other[...,i]).reshape(self.shape+(1,)) +
|
||||||
(B * p_m[...,i]).reshape(self.shape+(1,)) +
|
(B * p_m[...,i]).reshape(self.shape+(1,)) +
|
||||||
|
@ -481,7 +481,7 @@ class Rotation:
|
||||||
else M + r.asM() * n # noqa add (multiples) of this rotation to average noqa
|
else M + r.asM() * n # noqa add (multiples) of this rotation to average noqa
|
||||||
eig, vec = np.linalg.eig(M/N)
|
eig, vec = np.linalg.eig(M/N)
|
||||||
|
|
||||||
return Rotation.fromQuaternion(np.real(vec.T[eig.argmax()]),acceptHomomorph = True)
|
return Rotation.from_quaternion(np.real(vec.T[eig.argmax()]),acceptHomomorph = True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_random(shape=None):
|
def from_random(shape=None):
|
||||||
|
|
Loading…
Reference in New Issue