Point3D.Addition(Point3D, Vector3D) 运算符

定义

Point3D 添加一个 Vector3D 结构并以 Point3D 结构返回结果。

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

参数

point
Point3D

要添加的点。

vector
Vector3D

要添加的向量。

返回

Point3D

Point3D 结构,它是 pointvector 之和。

示例

以下示例演示如何向 Vector3D 结构添加结构 Point3D

// Translates a Point3D by a Vector3D using the overloaded + operator. 
// Returns a Point3D.

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

pointResult = point1 + vector1;
// point3DResult is equal to (30, 35, 41)

// Displaying Results
syntaxString = "pointResult = point1 + vector1;";
resultType = "Point3D";
operationString = "Adding a 3D Point and a 3D Vector";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
' Translates a Point3D by a Vector3D using the overloaded + operator. 
' 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 = point1 + vector1
' point3DResult is equal to (30, 35, 41)

' Displaying Results
syntaxString = "pointResult = point1 + vector1"
resultType = "Point3D"
operationString = "Adding a 3D Point and a 3D Vector"
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString)

注解

禁止向 Point3D 结构添加结构 Point3D

适用于

另请参阅