Vector3D.UnaryNegation(Vector3D) Operator

Definition

Negates a Vector3D structure.

C#
public static System.Windows.Media.Media3D.Vector3D operator -(System.Windows.Media.Media3D.Vector3D vector);

Parameters

vector
Vector3D

The Vector3D structure to negate.

Returns

A Vector3D structure with X, Y, and Z values opposite of the X, Y, and Z values of vector.

Examples

The following example shows how to use the overloaded negation operator to negate a Vector3D structure.

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

Remarks

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

Applies to

Tuote Versiot
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also