Point3D.Add(Point3D, Vector3D) Method

Definition

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

C#
public static System.Windows.Media.Media3D.Point3D Add(System.Windows.Media.Media3D.Point3D point, System.Windows.Media.Media3D.Vector3D vector);

Parameters

point
Point3D

The Point3D structure to add.

vector
Vector3D

The Vector3D structure to add.

Returns

The sum of point and vector.

Examples

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

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

Remarks

Adding a Point3D structure to a Vector3D structure is prohibited.

Applies to

Produkt Verzie
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also