Vector3D.Subtraction Operator (Vector3D, Point3D)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Subtracts a Point3D structure from a Vector3D structure.

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

public static Point3D operator -(
	Vector3D vector,
	Point3D point
)

Parameters

vector
Type: System.Windows.Media.Media3D.Vector3D

The Vector3D structure to be subtracted from.

point
Type: System.Windows.Media.Media3D.Point3D

The Point3D structure to subtract from vector.

Return Value

Type: System.Windows.Media.Media3D.Point3D

The result of subtracting point from vector.

The following example shows how to use the overloaded subtraction operator to subtract a Point3D structure from a Vector3D structure.

// Subtracts a Vector3D from a Point3D using the overloaded - operator.
// Returns a Point3D.

Point3D point1 = new Point3D(10, 5, 1);
Vector3D vector1 = new Vector3D(20, 30, 40);
Point3D pointResult = new Point3D();

// Subtracting the vector from the point
pointResult = vector1 - point1;

// pointResult is equal to (10, 25, 39) 

.NET Framework
Available since 3.0
Return to top
Show: