Converts a pair angle-vector into a quaternion.
Converts a 3X3 (numpy) matrix into a vector having Euler angles as components.
Converts a vector whose components are Euler angles into a quaternion.
Returns the dot product of two quaternions.
>>> a = qmath.quaternion('1+2i-2k')
>>> b = qmath.quaternion('3-2i+8j')
>>> qmath.dot(a,b)
-1.0
Returns the cross ratio of four quaternions.
If a and d or b and c are equal, returns the string 'Infinity'.
The arguments of CrossRatio can be passed as a tuple.
>>> a = qmath.quaternion([1,0,1,0])
>>> b = qmath.quaternion([0,1,0,1])
>>> c = qmath.quaternion([-1,0,-1,0])
>>> d = qmath.quaternion([0,-1,0,-1])
>>> qmath.CrossRatio(a,b,c,d)
(2.0)
>>> tpl = a,b,c,d
>>> qmath.CrossRatio(tpl)
(2.0)
>>> qmath.CrossRatio(a,b,b,d)
'Infinity'
>>> qmath.CrossRatio(a,a,a,d)
(1.0)
>>> qmath.CrossRatio(a,b,a,b)
(0.0)
Returns the Moebius transformation with parameters a,b,c and d.
If c * z + d == 0 returns the string 'Infinity'.
The arguments of Moebius can be passed as a tuple.
>>> a = qmath.quaternion([1,1,1,0])
>>> b = qmath.quaternion([-2,1,0,1])
>>> c = qmath.quaternion([1,0,0,0])
>>> d = qmath.quaternion([0,-1,-3,-4])
>>> z = qmath.quaternion([1,1,3,4])
>>> qmath.Moebius(z,a,b,c,d)
(-5.0+7.0i+7.0k)
>>> d = - z
>>> z = qmath.Moebius(z,a,b,c,d)
>>> z
'Infinity'
>>> qmath.Moebius(z,a,b,c,d)
(1.0+1.0i+1.0j)
References
[1] | (1, 2)
|
[2] | (1, 2)
|