Returns the angle (in radians) between this vector and the vector v.
oFloat = SIVector3.Angle( v ); |
Floating point value (angle in radians between this vector and the vector v).
Parameter | Type | Description |
---|---|---|
v | SIVector3 | Operand vector |
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 |
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 ) |