AnyCAD Rapid SDK  2020
The Rapid CAD SDK
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
GMat Class Reference

Public Member Functions

synchronized void delete ()
 
 GMat ()
 
 GMat (double a11, double a12, double a13, double a21, double a22, double a23, double a31, double a32, double a33)
 
 GMat (GXYZ Col1, GXYZ Col2, GXYZ Col3)
 
void SetCol (int Col, GXYZ Value)
 
void SetCols (GXYZ Col1, GXYZ Col2, GXYZ Col3)
 
void SetCross (GXYZ Ref)
 
void SetDiagonal (double X1, double X2, double X3)
 
void SetDot (GXYZ Ref)
 
void SetIdentity ()
 
void SetRotation (GXYZ Axis, double Ang)
 
void SetRow (int Row, GXYZ Value)
 
void SetRows (GXYZ Row1, GXYZ Row2, GXYZ Row3)
 
void SetScale (double S)
 
void SetValue (int Row, int Col, double Value)
 
GXYZ Column (int Col)
 
double Determinant ()
 
GXYZ Diagonal ()
 
GXYZ Row (int Row)
 
double Value (int Row, int Col)
 
boolean IsSingular ()
 
void Add (GMat Other)
 
GMat Added (GMat Other)
 
void Divide (double Scalar)
 
GMat Divided (double Scalar)
 
void Invert ()
 
GMat Inverted ()
 
GMat Multiplied (GMat Other)
 
void Multiply (GMat Other)
 
void PreMultiply (GMat Other)
 
GMat Multiplied (double Scalar)
 
void Multiply (double Scalar)
 
void Power (int N)
 
GMat Powered (int N)
 
void Subtract (GMat Other)
 
GMat Subtracted (GMat Other)
 
void Transpose ()
 
GMat Transposed ()
 

Protected Member Functions

 GMat (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long getCPtr (GMat obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

Describes a three column, three row matrix. This sort of object is used in various vectorial or matrix computations.

Constructor & Destructor Documentation

GMat.GMat ( )

creates a matrix with null coefficients.

GMat.GMat ( GXYZ  Col1,
GXYZ  Col2,
GXYZ  Col3 
)

Creates a matrix. Col1, Col2, Col3 are the 3 columns of the matrix.

Member Function Documentation

GMat GMat.Added ( GMat  Other)

Computes the sum of this matrix and the matrix Other for each coefficient of the matrix : <me>.Coef(i,j) + <Other>.Coef(i,j)

GXYZ GMat.Column ( int  Col)

Returns the column of Col index. Raises OutOfRange if Col < 1 or Col > 3

double GMat.Determinant ( )

Computes the determinant of the matrix.

GXYZ GMat.Diagonal ( )

Returns the main diagonal of the matrix.

GMat GMat.Divided ( double  Scalar)

Divides all the coefficients of the matrix by Scalar

GMat GMat.Inverted ( )

Inverses the matrix and raises if the matrix is singular. - Invert assigns the result to this matrix, while - Inverted creates a new one. Warning The Gauss LU decomposition is used to invert the matrix. Consequently, the matrix is considered as singular if the largest pivot found is less than or equal to gp::Resolution(). Exceptions Standard_ConstructionError if this matrix is singular, and therefore cannot be inverted.

boolean GMat.IsSingular ( )

The Gauss LU decomposition is used to invert the matrix (see Math package) so the matrix is considered as singular if the largest pivot found is lower or equal to Resolution from gp.

GMat GMat.Multiplied ( GMat  Other)

Computes the product of two matrices <me> * <Other>

void GMat.Multiply ( GMat  Other)

Computes the product of two matrices <me> = <Other> * <me>.

void GMat.Multiply ( double  Scalar)

Multiplies all the coefficients of the matrix by Scalar

GMat GMat.Powered ( int  N)

Computes <me> = <me> * <me> * .......* <me>, N time. if N = 0 <me> = Identity if N < 0 <me> = <me>.Invert() *...........* <me>.Invert(). If N < 0 an exception will be raised if the matrix is not inversible

GXYZ GMat.Row ( int  Row)

returns the row of Row index. Raises OutOfRange if Row < 1 or Row > 3

void GMat.SetCol ( int  Col,
GXYZ  Value 
)

Assigns the three coordinates of Value to the column of index Col of this matrix. Raises OutOfRange if Col < 1 or Col > 3.

void GMat.SetCols ( GXYZ  Col1,
GXYZ  Col2,
GXYZ  Col3 
)

Assigns the number triples Col1, Col2, Col3 to the three columns of this matrix.

void GMat.SetCross ( GXYZ  Ref)

Modifies the matrix M so that applying it to any number triple (X, Y, Z) produces the same result as the cross product of Ref and the number triple (X, Y, Z): i.e.: M * {X,Y,Z}t = Ref.Cross({X, Y ,Z}) this matrix is anti symmetric. To apply this matrix to the triplet {XYZ} is the same as to do the cross product between the triplet Ref and the triplet {XYZ}. Note: this matrix is anti-symmetric.

void GMat.SetDiagonal ( double  X1,
double  X2,
double  X3 
)

Modifies the main diagonal of the matrix. <me>.Value (1, 1) = X1 <me>.Value (2, 2) = X2 <me>.Value (3, 3) = X3 The other coefficients of the matrix are not modified.

void GMat.SetDot ( GXYZ  Ref)

Modifies this matrix so that applying it to any number triple (X, Y, Z) produces the same result as the scalar product of Ref and the number triple (X, Y, Z): this * (X,Y,Z) = Ref.(X,Y,Z) Note: this matrix is symmetric.

void GMat.SetIdentity ( )

Modifies this matrix so that it represents the Identity matrix.

void GMat.SetRotation ( GXYZ  Axis,
double  Ang 
)

Modifies this matrix so that it represents a rotation. Ang is the angular value in radians and the XYZ axis gives the direction of the rotation. Raises ConstructionError if XYZ.Modulus() <= Resolution()

void GMat.SetRow ( int  Row,
GXYZ  Value 
)

Assigns the three coordinates of Value to the row of index Row of this matrix. Raises OutOfRange if Row < 1 or Row > 3.

void GMat.SetRows ( GXYZ  Row1,
GXYZ  Row2,
GXYZ  Row3 
)

Assigns the number triples Row1, Row2, Row3 to the three rows of this matrix.

void GMat.SetScale ( double  S)

Modifies the the matrix so that it represents a scaling transformation, where S is the scale factor. : | S 0.0 0.0 | <me> = | 0.0 S 0.0 | | 0.0 0.0 S |

void GMat.SetValue ( int  Row,
int  Col,
double  Value 
)

Assigns <Value> to the coefficient of row Row, column Col of this matrix. Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 3

GMat GMat.Subtracted ( GMat  Other)

cOmputes for each coefficient of the matrix : <me>.Coef(i,j) - <Other>.Coef(i,j)

GMat GMat.Transposed ( )

Transposes the matrix. A(j, i) -> A (i, j)

double GMat.Value ( int  Row,
int  Col 
)

Returns the coefficient of range (Row, Col) Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 3