Point3D.Subtraction Operatore

Definizione

Sottrae una struttura Point3D o Vector3D da una struttura Point3D.Subtracts a Point3D structure or a Vector3D structure from a Point3D structure.

Overload

Subtraction(Point3D, Point3D)

Sottrae una struttura Point3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Vector3D.Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

Subtraction(Point3D, Vector3D)

Sottrae una struttura Vector3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Point3D.Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

Subtraction(Point3D, Point3D)

Sottrae una struttura Point3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Vector3D.Subtracts a Point3D structure from a Point3D structure and returns the result as a Vector3D structure.

public:
 static System::Windows::Media::Media3D::Vector3D operator -(System::Windows::Media::Media3D::Point3D point1, System::Windows::Media::Media3D::Point3D point2);
public static System.Windows.Media.Media3D.Vector3D operator - (System.Windows.Media.Media3D.Point3D point1, System.Windows.Media.Media3D.Point3D point2);
static member ( - ) : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Point3D -> System.Windows.Media.Media3D.Vector3D
Public Shared Operator - (point1 As Point3D, point2 As Point3D) As Vector3D

Parametri

point1
Point3D

Struttura Point3D sulla quale eseguire la sottrazione.The Point3D structure on which to perform subtraction.

point2
Point3D

Struttura Point3D che deve essere sottratta da point1.The Point3D structure to subtract from point1.

Restituisce

Vector3D

Struttura Vector3D che rappresenta la differenza tra point1 e point2.A Vector3D structure that represents the difference between point1 and point2.

Esempio

Nell'esempio seguente viene illustrato come utilizzare l'operatore di sottrazione di overload per sottrarre una Point3D struttura a una Point3D struttura.The following example shows how to use the overloaded subtraction operator to subtract a Point3D structure from a Point3D structure.

// Subtracts a Point3D from a Point3D using the overloaded - operator.
// Returns a Vector3D.

Point3D point1 = new Point3D(10, 5, 1);
Point3D point2 = new Point3D(15, 40, 60);
Vector3D vectorResult = new Vector3D();

vectorResult = point1 - point2;
// vectorResult is equal to (-5, -35, -59)

// Displaying Results
syntaxString = " vectorResult = point1 - point2;";
resultType = "Vector3D";
operationString = "Subtracting a Point3D from a Point3D";
ShowResults(vectorResult.ToString(), syntaxString, resultType, operationString);
' Subtracts a Point3D from a Point3D using the overloaded - operator.
' Returns a Vector3D.

Dim point1 As New Point3D(10, 5, 1)
Dim point2 As New Point3D(15, 40, 60)
Dim vectorResult As New Vector3D()

vectorResult = point1 - point2
' vectorResult is equal to (-5, -35, -59)

' Displaying Results
syntaxString = " vectorResult = point1 - point2"
resultType = "Vector3D"
operationString = "Subtracting a Point3D from a Point3D"
ShowResults(vectorResult.ToString(), syntaxString, resultType, operationString)

Vedi anche

Si applica a

Subtraction(Point3D, Vector3D)

Sottrae una struttura Vector3D da una struttura Point3D e restituisce il risultato sotto forma di struttura Point3D.Subtracts a Vector3D structure from a Point3D structure and returns the result as a Point3D structure.

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

Parametri

point
Point3D

Struttura Point3D dalla quale sottrarre il vettore.The Point3D structure from which to subtract vector.

vector
Vector3D

Struttura Vector3D che deve essere sottratta dal punto.The Vector3D structure to subtract from point.

Restituisce

Point3D

Struttura Point3D modificata, ovvero il risultato della sottrazione di vector da point.The changed Point3D structure, the result of subtracting vector from point.

Esempio

Nell'esempio seguente viene illustrato come utilizzare l'operatore di sottrazione di overload per sottrarre una Vector3D struttura a una Point3D struttura.The following example shows how to use the overloaded subtraction operator to subtract a Vector3D structure from a Point3D structure.

// Subtracts a Vector3D from a Point3D using the overloaded - operator.
// Returns a Point3D.

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

pointResult = point1 - vector1;
// pointResult is equal to (-10, -25, -39) 

// Displaying Results
syntaxString = "pointResult = point1 - vector1;";
resultType = "Point3D";
operationString = "Subtracting a Vector3D from a Point3D";
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString);
' Subtracts a Vector3D from a Point3D using the overloaded - operator.
' 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 = point1 - vector1
' pointResult is equal to (-10, -25, -39) 

' Displaying Results
syntaxString = "pointResult = point1 - vector1"
resultType = "Point3D"
operationString = "Subtracting a Vector3D from a Point3D"
ShowResults(pointResult.ToString(), syntaxString, resultType, operationString)

Vedi anche

Si applica a