Vector3D.AngleBetween(Vector3D, Vector3D) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public:
static double AngleBetween(System::Windows::Media::Media3D::Vector3D vector1, System::Windows::Media::Media3D::Vector3D vector2);
public static double AngleBetween (System.Windows.Media.Media3D.Vector3D vector1, System.Windows.Media.Media3D.Vector3D vector2);
static member AngleBetween : System.Windows.Media.Media3D.Vector3D * System.Windows.Media.Media3D.Vector3D -> double
Public Shared Function AngleBetween (vector1 As Vector3D, vector2 As Vector3D) As Double
参数
返回
将 vector1
旋转为 vector2
所需的角度(以度为单位)。
示例
下面的示例演示如何获取两 Vector3D 个结构之间的角度。
// Calculates the angle between two Vector3Ds using the static AngleBetween method.
// Returns a Double.
Vector3D vector1 = new Vector3D(20, 30, 40);
Vector3D vector2 = new Vector3D(45, 70, 80);
Double angleBetween;
angleBetween = Vector3D.AngleBetween(vector1, vector2 );
// angleBetween is approximately equal to 4.15129
' Calculates the angle between two Vector3Ds using the static AngleBetween method.
' Returns a Double.
Dim vector1 As New Vector3D(20, 30, 40)
Dim vector2 As New Vector3D(45, 70, 80)
Dim angleBetween As Double
angleBetween = Vector3D.AngleBetween(vector1, vector2)
' angleBetween is approximately equal to 4.15129
注解
带符号角度不会扩展到三维空间,因此返回 0 到 180 度之间的角度。