AnyCAD Rapid API 2026
Help you to create a better world!
载入中...
搜索中...
未找到
AnyCAD.Foundation.GMat类 参考

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

类 AnyCAD.Foundation.GMat 继承关系图:

Public 成员函数

 GMat (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
void Dispose ()
 
 GMat ()
 creates a matrix with null coefficients.
 
 GMat (double theA11, double theA12, double theA13, double theA21, double theA22, double theA23, double theA31, double theA32, double theA33)
 
 GMat (GXYZ theCol1, GXYZ theCol2, GXYZ theCol3)
 Creates a matrix. theCol1, theCol2, theCol3 are the 3 columns of the matrix.
 
void SetCol (int theCol, GXYZ theValue)
 Assigns the three coordinates of theValue to the column of index theCol of this matrix. Raises OutOfRange if theCol < 1 or theCol > 3.
 
void SetCols (GXYZ theCol1, GXYZ theCol2, GXYZ theCol3)
 Assigns the number triples theCol1, theCol2, theCol3 to the three columns of this matrix.
 
void SetCross (GXYZ theRef)
 Modifies the matrix M so that applying it to any number triple (X, Y, Z) produces the same result as the cross product of theRef and the number triple (X, Y, Z): i.e.: M * {X,Y,Z}t = theRef.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 theRef and the triplet {XYZ}. Note: this matrix is anti-symmetric.
 
void SetDiagonal (double theX1, double theX2, double theX3)
 
void SetDot (GXYZ theRef)
 Modifies this matrix so that applying it to any number triple (X, Y, Z) produces the same result as the scalar product of theRef and the number triple (X, Y, Z): this * (X,Y,Z) = theRef.(X,Y,Z) Note: this matrix is symmetric.
 
void SetIdentity ()
 Modifies this matrix so that it represents the Identity matrix.
 
void SetRotation (GXYZ theAxis, double theAng)
 Modifies this matrix so that it represents a rotation. theAng is the angular value in radians and the XYZ axis gives the direction of the rotation. Raises ConstructionError if XYZ.Modulus() <= Resolution()
 
void SetRow (int theRow, GXYZ theValue)
 Assigns the three coordinates of Value to the row of index theRow of this matrix. Raises OutOfRange if theRow < 1 or theRow > 3.
 
void SetRows (GXYZ theRow1, GXYZ theRow2, GXYZ theRow3)
 Assigns the number triples theRow1, theRow2, theRow3 to the three rows of this matrix.
 
void SetScale (double theS)
 Modifies the matrix so that it represents a scaling transformation, where theS is the scale factor. :<code> | theS 0.0 0.0 | &lt;me&gt; = | 0.0 theS 0.0 | | 0.0 0.0 theS |</code>
 
void SetValue (int theRow, int theCol, double theValue)
 Assigns <theValue> to the coefficient of row theRow, column theCol of this matrix. Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3
 
GXYZ Column (int theCol)
 Returns the column of theCol index. Raises OutOfRange if theCol < 1 or theCol > 3
 
double Determinant ()
 Computes the determinant of the matrix.
 
GXYZ Diagonal ()
 Returns the main diagonal of the matrix.
 
GXYZ Row (int theRow)
 returns the row of theRow index. Raises OutOfRange if theRow < 1 or theRow > 3
 
double Value (int theRow, int theCol)
 Returns the coefficient of range (theRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3
 
bool 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.
 
void Add (GMat theOther)
 
GMat Added (GMat theOther)
 Computes the sum of this matrix and the matrix theOther for each coefficient of the matrix : <me>.Coef(i,j) + <theOther>.Coef(i,j)
 
void Divide (double theScalar)
 
GMat Divided (double theScalar)
 Divides all the coefficients of the matrix by Scalar
 
void Invert ()
 
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.
 
GMat Multiplied (GMat theOther)
 Computes the product of two matrices <me> * <Other>
 
void Multiply (GMat theOther)
 Computes the product of two matrices <me> = <Other> * <me>.
 
void PreMultiply (GMat theOther)
 
GMat Multiplied (double theScalar)
 
void Multiply (double theScalar)
 Multiplies all the coefficients of the matrix by Scalar
 
void Power (int N)
 
GMat Powered (int theN)
 Computes <me> = <me> * <me> * .......* <me>, theN time. if theN = 0 <me> = Identity if theN < 0 <me> = <me>.Invert() *...........* <me>.Invert(). If theN < 0 an exception will be raised if the matrix is not inversible
 
void Subtract (GMat theOther)
 
GMat Subtracted (GMat theOther)
 cOmputes for each coefficient of the matrix : <me>.Coef(i,j) - <theOther>.Coef(i,j)
 
void Transpose ()
 
GMat Transposed ()
 Transposes the matrix. A(j, i) -> A (i, j)
 

详细描述

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

成员函数说明

◆ SetDiagonal()

void AnyCAD.Foundation.GMat.SetDiagonal ( double theX1,
double theX2,
double theX3 )

Modifies the main diagonal of the matrix.<code> &lt;me&gt;.Value (1, 1) = theX1 &lt;me&gt;.Value (2, 2) = theX2 &lt;me&gt;.Value (3, 3) = theX3</code> The other coefficients of the matrix are not modified.