共用方式為


Point4D.Subtraction(Point4D, Point4D) 運算子

定義

Point4D 結構減去 Point4D 結構,並傳回 Point4D 結構的結果。

public:
 static System::Windows::Media::Media3D::Point4D operator -(System::Windows::Media::Media3D::Point4D point1, System::Windows::Media::Media3D::Point4D point2);
public static System.Windows.Media.Media3D.Point4D operator - (System.Windows.Media.Media3D.Point4D point1, System.Windows.Media.Media3D.Point4D point2);
static member ( - ) : System.Windows.Media.Media3D.Point4D * System.Windows.Media.Media3D.Point4D -> System.Windows.Media.Media3D.Point4D
Public Shared Operator - (point1 As Point4D, point2 As Point4D) As Point4D

參數

point1
Point4D

要減去其中內容的 Point4D 結構。

point2
Point4D

要從 point1 中減去的 Point4D 結構。

傳回

傳回 point1point2 之間的差。

範例

下列範例示範如何使用多載減法運算子從 結構減去 Point4D 結構 Point4D

// Subtracts a Point4D from a Point4D using the overloaded - operator.
// Returns a Point4D.

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

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

// Displaying Results
syntaxString = "pointResult = point1 - point2;";
resultType = "Point4D";
operationString = "Subtracting a Vector3D from a Point4D";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
' Subtracts a Point4D from a Point4D using the overloaded - operator.
' Returns a Point4D.

Dim point1 As New Point4D(10, 5, 1, 4)
Dim point2 As New Point4D(15, 40, 60, 75)
Dim pointResult As New Point4D()

pointResult = point1 - point2
' pointResult is equal to (-5, -35, -59, -71) 

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

適用於

另請參閱