Vector3D.UnaryNegation(Vector3D) 運算子
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將 Vector3D 結構加上負號。
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
參數
傳回
Vector3D 結構,其 X、Y 和 Z 值與 vector
的 X、Y 和 Z 值正負號相反。
範例
下列範例示範如何使用多載負運算子來否定 Vector3D 結構。
// 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 的結構的大小與 () Lengthvector
相同,但其方向與 的 vector
相反。