IC Python API:RLPy RQuaternion
Contents
- 1 Detailed Description
- 2 Operators
- 3 Member Functions
- Main article: Modules.
Detailed Description
This class represent the quaternion in math. Quaternions represent orientations as a single rotation, just as rectangular co- ordinates represent position as a single vector.
Operators
This class supports the following operators:
Member | Operation | Syntax | Description | Example |
---|---|---|---|---|
__add__ | Addition | a + b | Adds values on either side of the operator. | a + b = 30 |
__sub__ | Subtraction | a - b | Subtracts right hand operand from left hand operand. | a – b = -10 |
__mul__ | Multiplication | a * b | Multiplies values on either side of the operator. | a * b = 200 |
__truediv__ | Division | a / b | Divides left hand operand by right hand operand. | b / a = 2 |
__neg__ | Negation | -a | Return the value negated. | a = -b |
__eq__ | Equality | a == b | If the values of two operands are equal, then the condition becomes true. | (a == b) is not true. |
__ne__ | Difference | a != b | If values of two operands are not equal, then condition becomes true. | (a != b) is true. |
__gt__ | Greater Than | a > b | If the value of left operand is greater than the value of right operand, then condition becomes true. | (a > b) is not true. |
__lt__ | Less Than | a < b | If the value of left operand is less than the value of right operand, then condition becomes true. | (a < b) is true. |
__ge__ | Greater Than or Equal | a >= b | If the value of left operand is greater than or equal to the value of right operand, then condition becomes true. | (a >= b) is not true. |
__le__ | Less or Equal | a <= b | If the value of left operand is less than or equal to the value of right operand, then condition becomes true. | (a <= b) is true. |
__iadd__ | Addition (Inplace) | a += b | It adds right operand to the left operand and assign the result to left operand. | c += a is equivalent to c = c + a |
__isub__ | Subtraction (Inplace) | a -= b | It subtracts right operand from the left operand and assign the result to left operand. | c -= a is equivalent to c = c - a |
__imul__ | Multiply (Inplace) | a *= b | It multiplies right operand with the left operand and assign the result to left operand. | c *= a is equivalent to c = c * a |
__itruediv__ | Divide (Inplace) | a /= b | It divides left operand with the right operand and assign the result to left operand. | c /= a is equivalent to c = c / ac /= a is equivalent to c = c / a |
Member Functions
AlmostEquel
RLPy.RQuaternion.AlmostEquel ( self, qQ )
Equality test.
Parameters
qQ [IN] The quaternion - RLPy.RQuaternion
Returns
Conjugate
RLPy.RQuaternion.Conjugate ( self )
Conjugate this quaternion.
Returns
Dot
RLPy.RQuaternion.Dot ( self, qQ )
Calculate dot production of the two quaternion.
Parameters
qQ [IN] The quaternion - RLPy.RQuaternion
Returns
FromAxisAngle
RLPy.RQuaternion.FromAxisAngle ( self, rkAxis, fAngle )
Quaternion from a axis angle.
Parameters
rkAxis [IN] axis vector - RLPy.RVector3
fAngle [IN] angle in radians - float
Returns
FromRotationMatrix
RLPy.RQuaternion.FromRotationMatrix ( self, rkRot )
Quaternion from a rotation matrix.
Parameters
rkRot [IN] Rotation matrix - RLPy.RMatrix3
Returns
Inverse
RLPy.RQuaternion.Inverse ( self )
Inverse this quaternion.
Returns
Multiply
RLPy.RQuaternion.Multiply ( self, qQ )
Multiply quaternion.
Returns
MultiplyEqual
RLPy.RQuaternion.MultiplyEqual ( self, qQ )
Multiply quaternion.
Returns
Normalize
RLPy.RQuaternion.Normalize ( self )
Normalizes this quaternion.
Returns
Rotate180
RLPy.RQuaternion.Rotate180 ( self )
Rotate 180 degree of this quaternion.
Returns
SetW
RLPy.RQuaternion.SetW ( self, tW )
Set the w value of the quaternion.
Returns
SetX
RLPy.RQuaternion.SetX ( self, tX )
Set the x value of the quaternion.
Returns
SetY
RLPy.RQuaternion.SetY ( self, tY )
Set the y value of the quaternion.
Returns
SetZ
RLPy.RQuaternion.SetZ ( self, tZ )
Set the z value of the quaternion.
Returns
ToAxisAngle
RLPy.RQuaternion.ToAxisAngle ( self, rkAxis, rfAngle )
Convert quaternion to axis angle.
Parameters
rkAxis [OUT] Returns axis vector - RLPy.RVector3
fAngle [OUT] Returns angle in radians.
ToRotationMatrix
RLPy.RQuaternion.ToRotationMatrix ( self )
Convert quaternion to a rotation matrix.
Returns
W
RLPy.RQuaternion.W ( self, args )
Get the w value of the quaternion.
Returns
X
RLPy.RQuaternion.X ( self, args )
Get the x value of the quaternion.
Returns
Y
RLPy.RQuaternion.Y ( self, args )
Get the y value of the quaternion.
Returns
Z
RLPy.RQuaternion.Z ( self, args )
Get the z value of the quaternion.