SIMatrix3.TransposeInverse

SIMatrix3.TransposeInverse

説明

この行列を、入力行列 m の転置逆行列に設定します(特異行列でない場合)(this = Transpose(m^-1))。

C#構文

Int32 SIMatrix3.TransposeInverse( SIMatrix3 in_pMatrix );

スクリプト構文

oBoolean = SIMatrix3.TransposeInverse( m );

戻り値

Boolean。行列 m が逆行列を持つ(特異でない)場合は True、逆行列を持たない場合は false。

パラメータ

パラメータ タイプ 説明
m SIMatrix3 行列オペランド

1. VBScript の例

dim m1, m2

' Create 3x3 matrices.

set m1 = XSIMath.CreateMatrix3(2.0, 3.0, 0.0, 1.0, 4.0, 0.0, 0.0, 0.0, 1.0)

set m2 = XSIMath.CreateMatrix3

if m2.TransposeInverse( m1 ) then

'do something

else

'do another thing

end if

2. JScript の例

NewScene (null, false);

var oRoot = Application.ActiveProject.ActiveScene.Root

// Create two cubes, the first one is rotated by 45 degrees and second

// is the transpose inverse of the first one="SIMatrix4.TransposeInverseInPlace

var oCube = oRoot.AddGeometry("Cube","MeshSurface", "CubeParent")	

var oCube2 = oRoot.AddGeometry("Cube","MeshSurface", "CubeParent")	

var oTrans = oCube.Kinematics.Local.Transform

var oTrans2 = oCube2.Kinematics.Local.Transform

var oMat3 = XSIMath.CreateMatrix3()

oTrans2.GetRotationMatrix3 ( oMat3 );

// Modify the matrix to scale and rotate around z

oMat3.value(0,0) = 2 * Math.cos (45);

oMat3.value(0,1) = -2 * Math.sin (45);

oMat3.value(1,1) = 2 * Math.cos (45);

oMat3.value(1,0) = 2 * Math.sin (45);

oTrans.SetRotationFromMatrix3 ( oMat3 );	

oCube.Kinematics.Local.Transform = oTrans;

var vbArr = new VBArray( oMat3.Get2() );

var array = vbArr.toArray();

Application.LogMessage( "SIMatrix3 before transpose " +

	" m00:" + array[0] + " m01:" + array[1] + " m02:" + array[2] + 

	" m10:" + array[3] + " m11:" + array[4] + " m12:" + array[5] + 

	" m20:" + array[6] + " m21:" + array[7] + " m22:" + array[8] );

var oMat3Trans = XSIMath.CreateMatrix3()

oMat3Trans.TransposeInverse(oMat3)

oTrans2.SetRotationFromMatrix3 ( oMat3Trans );

var vbArr = new VBArray( oMat3Trans.Get2() );

var array = vbArr.toArray();

Application.LogMessage( "SIMatrix3 after transpose " +

	" m00:" + array[0] + " m01:" + array[1] + " m02:" + array[2] + 

	" m10:" + array[3] + " m11:" + array[4] + " m12:" + array[5] + 

	" m20:" + array[6] + " m21:" + array[7] + " m22:" + array[8] );

oCube2.Kinematics.Local.Transform = oTrans2;

// Expected results:

//INFO : SIMatrix3 before transpose  

//			m00:1.0506439776354594	m01:-1.7018070490682368 m02:0 

//			m10:1.7018070490682368	m11:1.0506439776354594	m12:0 

//			m20:0                   m21:0                   m22:1

//INFO : SIMatrix3 after transpose  

//			m00:0.26266099440886486 m01:-0.4254517622670592 m02:0 

//			m10:0.4254517622670592	m11:0.26266099440886486 m12:0 

//			m20:0                   m21:0                   m22:1

関連項目

SIMatrix3.TransposeInverseInPlace SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion