共用方式為


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)

備註

向量的大小和之前一樣,但是現在方向相反。

適用於

另請參閱