IC Python API:RLPy RMatrix3

From Reallusion Wiki!
Revision as of 00:03, 28 March 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class represent the 3x3 matrix. ==Operators== This class supports the following operat...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Main article: Modules.

Detailed Description

This class represent the 3x3 matrix.

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

AccuScale

RLPy.RMatrix3.AccuScale ( self, rkScale )

Accumulate matrix with scale vector.

Parameters

rkScale [IN] Scale vector - RLPy.RVector3

Returns

Return a new matrix - RLPy.RMatrix3

Adjoint

RLPy.RMatrix3.Adjoint ( self )

Inverse times determinant.

Returns

A new matrix containing this matrix's adjoint - RLPy.RMatrix3

AdjointTranspose

RLPy.RMatrix3.AdjointTranspose ( self )

Transpose of inverse times determinant.

Returns

A new matrix - RLPy.RMatrix3

Determinant

RLPy.RMatrix3.Determinant ( self )

The matrix's determinant.

Returns

The determinant of the matrix - float

E

RLPy.RMatrix3.E ( self, args )

Get the matrix element for the specified index(0~8).

Parameters

nRow [IN] Index of the matrix.

Returns

The matrix element specified by index - float

FromAxisAngle

RLPy.RMatrix3.FromAxisAngle ( self, rkAxis, fAngle )

Rotation matrix from axis angle.

Parameters

rkAxis [IN] axis vector - RLPy.RVector3

fAngle [IN] angle in radians - float

Returns

Return a new matrix from specified axis angle - RLPy.RMatrix3

FromEulerAngle

RLPy.RMatrix3.FromEulerAngle ( Oreder, rx, ry, rz )

Rotation matrix from Euler angle.

Parameters

Oreder [IN] Euler order - RLPy.Rotation_Order

rx [IN] Angle of x-axis in radians - float

ry [IN] Angle of y-axis in radians - float

rz [IN] Angle of z-axis in radians - float

Returns

Return a new matrix from specified axis angle - RLPy.RMatrix3

FromSpereUnitVec

RLPy.RMatrix3.FromSpereUnitVec ( self, rkVec )

Rotation matrix from sphere unit vector.

Parameters

rkVec [IN] vector - RLPy.RVector3

Returns

Return a new matrix from sphere unit vector - RLPy.RMatrix3

GetColumn

RLPy.RMatrix3.GetColumn ( self, nCol )

Get the matrix element for the specified column.

Parameters

nRow [IN] Index of the column in the matrix.

Returns

The column vector of the matrix - RLPy.RVector3

GetRow

RLPy.RMatrix3.GetRow ( self, nRow )

Get the matrix element for the specified row.

Parameters

nRow [IN] Index of the row in the matrix - int

Returns

The row vector of the matrix - RLPy.RVector3

InfNorm

RLPy.RMatrix3.InfNorm ( self )

InfNorm of the matrix.

Returns

Return InfNorm - float

Inverse

RLPy.RMatrix3.Inverse ( self )

Inverse of the matrix.

Returns

A new matrix containing this matrix's inverse - RLPy.RMatrix3

InverseTranspose

RLPy.RMatrix3.InverseTranspose ( self )

Transpose of inverse.

Returns

A new matrix - RLPy.RMatrix3

IsRightHandCoordinate

RLPy.RMatrix3.IsRightHandCoordinate ( self )

Determine the coordinate is right hand or left hand.

Return Values

true Right hand coordinate

true Left hand coordinate


M

RLPy.RMatrix3.M ( self, args )

Get the matrix element for the specified row and column.

Parameters

nRow [IN] Index of the row in the matrix - int

nCol [IN] Index of the column in the matrix - int

Returns

The matrix element specified by row and col - float

MakeIdentity

RLPy.RMatrix3.MakeIdentity ( self )

Sets the matrix to the identity.

Returns

This object - RLPy.RMatrix3

MaxColumn

RLPy.RMatrix3.MaxColumn ( self )

Get maximum value of the column index in the matrix.

Returns

Return index of column of M containing maximum abs entry, or -1 if M = 0 - int

MaxRow

RLPy.RMatrix3.MaxRow ( self )

Get maximum value of the row index in the matrix.

Returns

Return index of row of M containing maximum abs entry, or -1 if M = 0 - int

OneNorm

RLPy.RMatrix3.OneNorm ( self )

Norm of the matrix.

Returns

Return Norm - float

RotationX

RLPy.RMatrix3.RotationX ( self, fAngle )

Rotation matrix for rotations around x-axis.

Parameters

fAngle [IN] angle in radians - float

Returns

Return a new matrix of for rotations around x-axis - RLPy.RMatrix3

RotationY

RLPy.RMatrix3.RotationY ( self, fAngle )

Rotation matrix for rotations around y-axis.

Parameters

fAngle [IN] angle in radians - float

Returns

Return a new matrix of for rotations around y-axis - RLPy.RMatrix3

RotationZ

RLPy.RMatrix3.RotationZ ( self, fAngle )

Rotation matrix for rotations around z-axis.

Parameters

fAngle [IN] angle in radians - float

Returns

Return a new matrix of for rotations around z-axis - RLPy.RMatrix3

TimesTranspose

RLPy.RMatrix3.TimesTranspose ( self, mM )

Multiplies of the transpose of the matrix.

Parameters

mM [IN] the matrix - RLPy.RMatrix3

Returns

A new matrix. (this * M^T) - RLPy.RMatrix3

ToEulerAngle

RLPy.RMatrix3.ToEulerAngle ( self, Oreder, rx, ry, rz )

Convert matrix to Euler angle.

Parameters

Oreder [IN] Euler order - RLPy.Rotation_Order

rx [OUT] return angle of x-axis in radians - float

ry [OUT] return angle of y-axis in radians - float

rz [OUT] return angle of z-axis in radians - float


Transpose

RLPy.RMatrix3.Transpose ( self )

Transpose of the matrix.

Returns

A new matrix containing this matrix's transpose - RLPy.RMatrix3

TransposeTimes

RLPy.RMatrix3.TransposeTimes ( self, mM )

Multiplies of the transpose of the matrix.

Parameters

mM [IN] the matrix - RLPy.RMatrix3

Returns

A new matrix. (this^T * mM) - RLPy.RMatrix3