SIQuaternion.EpsilonEquals

説明

このクォータニオンとクォータニオンq が、epsilon の許容範囲内で等しいかテストします。

C#構文

Int32 SIQuaternion.EpsilonEquals( SIQuaternion in_pQuat, Double in_dEpsilon );

スクリプト構文

oBoolean = SIQuaternion.EpsilonEquals( epsilon );

戻り値

Boolean このクォータニオンがクォータニオン q と等しい場合は True、等しくない場合は false。

パラメータ

パラメータ タイプ 説明
epsilon SIQuaternion tolerance

指定可能な値:

説明:

[0, +INF[ Validity ドメイン

JScript の例

/*

	This example demonstrates how to test whether the values of two

	quaternions are within 0.002 of each other using the EpsilonEquals method

*/

var q1 = XSIMath.CreateQuaternion(1.0, 1.0, 2.0, 3.0);

var q2 = XSIMath.CreateQuaternion(1.0, 1.001, 2.0, 3.0);

var q3 = XSIMath.CreateQuaternion(1.0, 1.003, 2.0, 3.0);

// Equal by less than 0.002

ValidateEpsilonEquals(q1, q2);

// Not equal by less than 0.002

ValidateEpsilonEquals(q1, q3);

function ValidateEpsilonEquals (in_q1 , in_q2)

{

	if ( in_q1.EpsilonEquals(in_q2, 0.002) ) {

		Application.LogMessage ("in_q1 is equal to in_q2 by less than 0.002");

	} else {

		Application.LogMessage ("in_q1 is not equal to in_q2 by less than 0.002");

	}

}

// Expected results:

// INFO : in_q1 is equal to in_q2 by less than 0.002

// INFO : in_q1 is not equal to in_q2 by less than 0.002

関連項目

SIQuaternion.Equals SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion