Vector3D.Negate 方法

定义

Vector3D 结构求反。

public:
 void Negate();
public void Negate ();
member this.Negate : unit -> unit
Public Sub Negate ()

示例

以下示例演示如何对 结构求 Vector3D 反。

// Negates a Vector3D using the Negate method.

Vector3D vector1 = new Vector3D(20, 30, 40);
Vector3D vectorResult = new Vector3D();

vector1.Negate();
// vector1 is equal to (-20, -30, -40)
' Negates a Vector3D using the Negate method.

Dim vector1 As New Vector3D(20, 30, 40)
Dim vectorResult As New Vector3D()

vector1.Negate()
' vector1 is equal to (-20, -30, -40)

注解

向量的大小与以前相同,但现在的方向与以前相反。

适用于

另请参阅