Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Subtract Method (Point3D, Point3D)
Collapse the table of content
Expand the table of content

Point3D.Subtract Method (Point3D, Point3D)

Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

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

public static Vector3D Subtract(
	Point3D point1,
	Point3D point2
)

Parameters

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

The Point3D structure to be subtracted from.

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

The Point3D structure to subtract from point1.

Return Value

Type: System.Windows.Media.Media3D.Vector3D
A Vector3D structure that represents the difference between point1 and point2.

The following example shows how to subtract a Point3D structure from a Point3D structure.

                        // Subtracts a Point3D from a Point3D using the static Subtract method.   
                        // Returns a Vector3D.

                        Point3D point1 = new Point3D(10, 5, 1);
                        Point3D point2 = new Point3D(15, 40, 60);
                        Vector3D vectorResult = new Vector3D();

                        vectorResult = Point3D.Subtract(point1, point2);
                        // vectorResult is equal to (-5, -35, -59) 

                        // Displaying Results
                        syntaxString = "vectorResult = Point3D.Subtract(point1, point2);";
                        resultType = "Vector3D";
						operationString = "Subtracting a Point3D from a Point3D";
						ShowResults(vectorResult.ToString(), syntaxString, resultType, operationString);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft