Vector3D.Add Method (Vector3D, Point3D)


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 Add(
	Vector3D vector,
	Point3D point


Type: System.Windows.Media.Media3D.Vector3D

The Vector3D structure used to translate the specified Point3D structure.

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 Add method to translate a Point3D structure by a Vector3D structure.

// Translates a Point3D by a Vector3D using the static Add method.  
// Returns a Point3D.

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

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

.NET Framework
Available since 3.0
Return to top