Vector3D.Addition Operator (Vector3D, Point3D)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Translates the specified Point3D structure by the specified Vector3D structure and returns the result as a Point3D structure.

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

public static Point3D operator +(
	Vector3D vector,
	Point3D point
)

Parameters

vector
Type: System.Windows.Media.Media3D.Vector3D

The Vector3D structure used to translate the specified Point3D structure.

point
Type: System.Windows.Media.Media3D.Point3D

The Point3D structure to be translated.

Return Value

Type: System.Windows.Media.Media3D.Point3D

The result of translating point by vector.

The following example shows how to use the overloaded addition operator to translate a Point3D structure by a Vector3D structure.

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

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

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

.NET Framework
Available since 3.0
Return to top
Show: