Export (0) Print
Expand All

Vector3D.UnaryNegation Operator

Negates a Vector3D structure.

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public static Vector3D operator -(
	Vector3D vector


Type: System.Windows.Media.Media3D.Vector3D
The Vector3D structure to negate.

Return Value

Type: System.Windows.Media.Media3D.Vector3D
A Vector3D structure with X, Y, and Z values opposite of the X, Y, and Z values of vector.

The returned Vector3D structure has the same magnitude (Length) as vector but its direction is opposite of that of vector.

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)

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

© 2014 Microsoft