Bagikan melalui


Vector3D.UnaryNegation(Vector3D) Operator

Definisi

Meniadakan Vector3D struktur.

public:
 static System::Windows::Media::Media3D::Vector3D operator -(System::Windows::Media::Media3D::Vector3D vector);
public static System.Windows.Media.Media3D.Vector3D operator - (System.Windows.Media.Media3D.Vector3D vector);
static member ( ~- ) : System.Windows.Media.Media3D.Vector3D -> System.Windows.Media.Media3D.Vector3D
Public Shared Operator - (vector As Vector3D) As Vector3D

Parameter

vector
Vector3D

Struktur Vector3D untuk meniadakan.

Mengembalikan

Struktur Vector3D dengan nilai , Y, dan Z yang berlawanan dengan Xnilai , Y, dan Z dari vector.X

Contoh

Contoh berikut menunjukkan cara menggunakan operator negasi yang kelebihan beban untuk meniadakan Vector3D struktur.

// Negates a Vector3D using the overloaded unary negation operator.

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

vectorResult = -vector1;
// vectorResult is equal to (-20, -30, -40)
' Negates a Vector3D using the overloaded unary negation operator.

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

vectorResult = -vector1
' vectorResult is equal to (-20, -30, -40)

Keterangan

Struktur yang dikembalikan Vector3D memiliki besaran yang sama (Length) seperti vector tetapi arahnya berlawanan dengan vector.

Berlaku untuk

Lihat juga