add#

Quaternion.add(other)#

Adds another quaternion or compatible value to this quaternion.

Parameters:
otherQuaternion, List, tuple, float, or int

The value to be added. It can be another Quaternion or a sequence that can be interpreted as one. It can also be a scalar value (float or int).

Returns:
Quaternion

A new quaternion representing the sum of this quaternion and the provided value.

Examples

>>> from ansys.aedt.core.generic.quaternion import Quaternion
>>> q1 = Quaternion(1, 2, 3, 4)
>>> q2 = Quaternion(5, 6, 7, 8)
>>> q1.add(q2)
Quaternion(6, 8, 10, 12)
>>> q1 + 7
Quaternion(8, 2, 3, 4)