Quaternion¶
-
class
sisl.
Quaternion
(angle=0.0, v=None, rad=False)¶ Bases:
object
Quaternion object to enable easy rotational quantities.
Attributes
__dict__
__doc__
__hash__
__module__
__weakref__
list of weak references to the object (if defined)
Returns the angle associated with this quaternion (in radians)
Returns the angle associated with this quaternion (in degree)
Returns the angle associated with this quaternion (in radians)
Methods
__add__
(other)Returns the added quantity
__delattr__
Implement delattr(self, name).
__dir__
Default dir() implementation.
__div__
(other)Divides with a scalar
__eq__
(other)Returns whether two Quaternions are equal
__format__
Default object formatter.
__ge__
Return self>=value.
__getattribute__
Return getattr(self, name).
__gt__
Return self>value.
__iadd__
(other)In-place addition
__idiv__
(other)In-place division
__imul__
(other)In-place multiplication
__init__
([angle, v, rad])Create quaternion object with angle and vector
__init_subclass__
This method is called when a class is subclassed.
__isub__
(other)In-place subtraction
__itruediv__
(other)In-place division
__le__
Return self<=value.
__lt__
Return self<value.
__mul__
(other)Multiplies with another instance or scalar
__ne__
Return self!=value.
__neg__
()Returns the negative quaternion
__new__
Create and return a new object.
__reduce__
Helper for pickle.
__reduce_ex__
Helper for pickle.
__repr__
Return repr(self).
__setattr__
Implement setattr(self, name, value).
__sizeof__
Size of object in memory, in bytes.
__str__
Return str(self).
__sub__
(other)Returns the subtracted quantity
__subclasshook__
Abstract classes can override this to customize issubclass().
__truediv__
(other)Divides with a scalar
conj
()Returns the conjugate of it-self
copy
()Return deepcopy of itself
norm
()Returns the norm of this quaternion
rotate
(v)Rotates 3-dimensional vector
v
with the associated quaternion-
property
angle
¶ Returns the angle associated with this quaternion (in radians)
-
property
degree
¶ Returns the angle associated with this quaternion (in degree)
-
property
radian
¶ Returns the angle associated with this quaternion (in radians)
-
property