Point4D.Subtract Method (Point4D, Point4D)

 

Subtracts a Point4D structure from a Point4D structure.

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

public static Point4D Subtract(
	Point4D point1,
	Point4D point2
)

Parameters

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

The Point4D structure to be subtracted from.

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

The Point4D structure to subtract from point1.

Return Value

Type: System.Windows.Media.Media3D.Point4D

Returns the difference between point1 and point2.

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

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

                  Point4D point1 = new Point4D(10, 5, 1, 4);
                  Point4D point2 = new Point4D(15, 40, 60, 75);
                  Point4D pointResult = new Point4D();

                  pointResult = Point4D.Subtract(point1, point2);
                  // pointResult is equal to (-5, -35, -59, -71)

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

.NET Framework
Available since 3.0
Return to top
Show: