Partager via


Point3D.Add(Point3D, Vector3D) Méthode

Définition

Ajoute une structure Point3D à un Vector3D et retourne le résultat sous forme de Point3D.

public:
 static System::Windows::Media::Media3D::Point3D Add(System::Windows::Media::Media3D::Point3D point, System::Windows::Media::Media3D::Vector3D vector);
public static System.Windows.Media.Media3D.Point3D Add (System.Windows.Media.Media3D.Point3D point, System.Windows.Media.Media3D.Vector3D vector);
static member Add : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Vector3D -> System.Windows.Media.Media3D.Point3D
Public Shared Function Add (point As Point3D, vector As Vector3D) As Point3D

Paramètres

point
Point3D

Structure Point3D à ajouter.

vector
Vector3D

Structure Vector3D à ajouter.

Retours

Point3D

Somme de point et vector.

Exemples

L'exemple suivant montre comment ajouter un Point3D dans un 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);
' Translates a Point3D by a Vector3D using the static Add method.
' Returns a Point3D.

Dim point1 As New Point3D(10, 5, 1)
Dim vector1 As New Vector3D(20, 30, 40)
Dim pointResult As 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)

Remarques

L’ajout d’une Point3D structure à une Vector3D structure est interdit.

S’applique à

Voir aussi