SIMatrix3 オブジェクトを戻します。この Matrix3 の値は配列(1D または 2D)の作成時または 9 つの値によって設定できます。
| m0 m1 m2 |
| m3 m4 m5 |
| m6 m7 m8 |
SIMatrix3 XSIMath.CreateMatrix3( Object in_d0, Object in_d1, Object in_d2, Object in_d3, Object in_d4, Object in_d5, Object in_d6, Object in_d7, Object in_d8 ); |
oReturn = XSIMath.CreateMatrix3( [m0_or_Array], [m1], [m2], [m3], [m4], [m5], [m6], [m7], [m8] ); |
パラメータ | タイプ | 説明 |
---|---|---|
m0_or_Array | DoubleまたはArray | m0値または9 つの値を含む配列(1Dまたは 2D) |
m1 | Double | m1 の値 |
m2 | Double | m2 の値 |
m3 | Double | m3 の値 |
m4 | Double | m4 の値 |
m5 | Double | m5 の値 |
m6 | Double | m6 の値 |
m7 | Double | m7 の値 |
m8 | Double | m8 の値 |
/* Set and display the values of a matrix3 */ var oMat3 = XSIMath.CreateMatrix3 (4.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 2.0); vbArr = new VBArray( oMat3.Get2() ); array = vbArr.toArray(); var lineSize = 3; //Display Matrix Application.LogMessage( "The 9 matrix values" ); var mgsString = ""; for (i =0; i < lineSize; i++ ) { for (j = 0; j < lineSize; j++ ) mgsString += "m" + i + "" + j + " " + array[ i*lineSize + j ] + " "; Application.LogMessage ( mgsString ); mgsString = ""; } //Expected output: //INFO : The 9 matrix values //INFO : m00 4 m01 0 m02 0 //INFO : m10 0 m11 3 m12 0 //INFO : m20 0 m21 0 m22 2 |
'test 2d matrix dim aValues2d( 3, 3) aValues2d(0,0) = 1.1 aValues2d(0,1) = 2 aValues2d(0,2) = 3 aValues2d(1,0) = 4.2 aValues2d(1,1) = 5 aValues2d(1,2) = 6 aValues2d(2,0) = 7.1 aValues2d(2,1) = 8 aValues2d(2,2) = 9 set oMatArray2d = XSIMath.CreateMatrix3(aValues2d) lineSize = 3 Application.LogMessage "The 9 matrix values" dim mgsString for i = 0 to lineSize - 1 for j = 0 to lineSize - 1 mgsString = mgsString + " m" & i & j & " " & oMatArray2d(i, j) next Application.LogMessage mgsString mgsString = "" next 'Expected output: 'INFO : The 9 matrix values 'INFO : m00 1.1 m01 2 m02 3 'INFO : m10 4.2 m11 5 m12 6 'INFO : m20 7.1 m21 8 m22 9 |