言語

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)

注釈

ベクトルの大きさは以前と同じですが、その方向は逆になっています。

適用対象

こちらもご覧ください