Point3D.Subtract Method (Point3D, Vector3D)

 

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

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

public static Point3D Subtract(
	Point3D point,
	Vector3D vector
)

Parameters

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

The Point3D structure from which to subtract vector.

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

The Vector3D structure to subtract from point.

Return Value

Type: System.Windows.Media.Media3D.Point3D

The difference between point and vector.

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

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

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

                  pointResult = Point3D.Subtract(point1, vector1);
                  // pointResult is equal to (-10, -25, -39)

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

.NET Framework
Available since 3.0
Return to top
Show: