Point3D.Subtract 方法

定义

从一个 Point3D 结构中减去另一个 Vector3D 结构或一个 Point3D 结构。Subtracts a Point3D structure or a Vector3D structure from a Point3D structure.

重载

Subtract(Point3D, Point3D)

从一个 Point3D 结构中减去另一个 Point3D 结构并以 Vector3D 结构返回结果。Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

Subtract(Point3D, Vector3D)

从一个 Vector3D 结构中减去另一个 Point3D 结构并以 Point3D 结构返回结果。Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

Subtract(Point3D, Point3D)

从一个 Point3D 结构中减去另一个 Point3D 结构并以 Vector3D 结构返回结果。Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

public:
 static System::Windows::Media::Media3D::Vector3D Subtract(System::Windows::Media::Media3D::Point3D point1, System::Windows::Media::Media3D::Point3D point2);
public static System.Windows.Media.Media3D.Vector3D Subtract (System.Windows.Media.Media3D.Point3D point1, System.Windows.Media.Media3D.Point3D point2);
static member Subtract : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Point3D -> System.Windows.Media.Media3D.Vector3D
Public Shared Function Subtract (point1 As Point3D, point2 As Point3D) As Vector3D

参数

point1
Point3D

作为被减数的 Point3D 结构。The Point3D structure to be subtracted from.

point2
Point3D

要从 point1 中减去的 Point3D 结构。The Point3D structure to subtract from point1.

返回

Vector3D 结构,它表示 point1point2 之间的差值。A Vector3D structure that represents the difference between point1 and point2.

示例

下面的示例演示如何Point3D Point3D从结构中减去结构。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);
' Subtracts a Point3D from a Point3D using the static Subtract method.  
' Returns a Vector3D.

Dim point1 As New Point3D(10, 5, 1)
Dim point2 As New Point3D(15, 40, 60)
Dim vectorResult As 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)

另请参阅

Subtract(Point3D, Vector3D)

从一个 Vector3D 结构中减去另一个 Point3D 结构并以 Point3D 结构返回结果。Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

public:
 static System::Windows::Media::Media3D::Point3D Subtract(System::Windows::Media::Media3D::Point3D point, System::Windows::Media::Media3D::Vector3D vector);
public static System.Windows.Media.Media3D.Point3D Subtract (System.Windows.Media.Media3D.Point3D point, System.Windows.Media.Media3D.Vector3D vector);
static member Subtract : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Vector3D -> System.Windows.Media.Media3D.Point3D
Public Shared Function Subtract (point As Point3D, vector As Vector3D) As Point3D

参数

point
Point3D

要从中减去 vectorPoint3D 结构。The Point3D structure from which to subtract vector.

vector
Vector3D

要从 point 中减去的 Vector3D 结构。The Vector3D structure to subtract from point.

返回

pointvector 之间的差值。The difference between point and vector.

示例

下面的示例演示如何Vector3D Point3D从结构中减去结构。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);
' Subtracts a Vector3D from a Point3D using the static Subtract method. 
' Returns a Point3D.

Dim point1 As New Point3D(10, 5, 1)
Dim vector1 As New Vector3D(20, 30, 40)
Dim pointResult As 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)

另请参阅

适用于