SIVector3.Angle

説明

このベクトルからベクトル vまでの角度(ラジアン単位)を戻します。

C#構文

Double SIVector3.Angle( SIVector3 in_pVector );

スクリプト構文

oFloat = SIVector3.Angle( v );

戻り値

Float。(このベクトルからベクトル vまでの角度(ラジアン単位))

パラメータ

パラメータ タイプ 説明
v SIVector3 オペランドベクトル

1. JScript の例

x = XSIMath.CreateVector3();

y = XSIMath.CreateVector3();

x.Set( 2,0,0 ) ;

y.Set( 1,1,0 ) ;

theta = x.Angle( y )

Application.LogMessage( "Angle is " + theta + " radians (" +  theta / XSIMath.Pi + " pi)" ) ;

Application.LogMessage( "Angle is " + XSIMath.RadiansToDegrees( x.Angle( y ) ) + " degrees" ) ;

//Output (rounded):

//INFO : Angle is 0.785398163 radians (0.25 pi)

//INFO : Angle is 45.0 degrees

2. VBScript の例

dim v1, v2

' Create 3D vectors.

set v1 = XSIMath.CreateVector3

set v2 = XSIMath.CreateVector3

v1.Set 1.0, 2.0, 3.0

v2.Set -1.0, 5.0, 6.0

angle = v1.Angle( v2 )

関連項目

SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion