Addition Operator

Point3D.Addition Operator (Point3D, Vector3D)


Adds a Point3D structure to a Vector3D and returns the result as a Point3D structure.

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

public static Point3D operator +(
	Point3D point,
	Vector3D vector


Type: System.Windows.Media.Media3D.Point3D

The point to add.

Type: System.Windows.Media.Media3D.Vector3D

The vector to add.

Return Value

Type: System.Windows.Media.Media3D.Point3D

A Point3D structure that is the sum of point and vector.

Adding a Point3D structure to a Point3D structure is prohibited.

The following example shows how to add a Vector3D structure to a Point3D structure.

// 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);

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft