Vector3D.UnaryNegation(Vector3D) 演算子

定義

Vector3D 構造体を反転します。Negates a Vector3D structure.

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

パラメーター

vector
Vector3D

反転する Vector3D 構造体。The Vector3D structure to negate.

戻り値

vectorVector3DXY の各値と逆符号の ZXY の各値を持つ Z 構造体。A Vector3D structure with X, Y, and Z values opposite of the X, Y, and Z values of vector.

オーバーロードされた否定演算子を使用して構造体をVector3D否定する方法を次の例に示します。The following example shows how to use the overloaded negation operator to negate a Vector3D structure.

// 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)

注釈

返されるVector3D構造体のマグニチュード (Length) はとvector同じですvectorが、その方向はとは逆になります。The returned Vector3D structure has the same magnitude (Length) as vector but its direction is opposite of that of vector.

適用対象

こちらもご覧ください