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

Parameters

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

The Point3D structure to add.

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

The Vector3D structure to add.

Return Value

Type: System.Windows.Media.Media3D.Point3D

The sum of point and vector.

Adding a Point3D structure to a Vector3D structure is prohibited.

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

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

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

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

                  // Displaying Results
                  syntaxString = "pointResult = Point3D.Add(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
Show: