Compartir a través de


Point3D.Inequality(Point3D, Point3D) Operador

Definición

Compara la desigualdad de dos estructuras Point3D.

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

Parámetros

point1
Point3D

Primera estructura Point3D que se va a comparar.

point2
Point3D

Segunda estructura Point3D que se va a comparar.

Devoluciones

Es true si las coordenadas X, Y y Z de point1 y point2 son diferentes; en caso contrario, es false.

Ejemplos

En el ejemplo siguiente se muestra cómo usar el operador de desigualdad sobrecargada para comprobar si dos Point3D estructuras no son iguales.

// Checks if two Point3Ds are not equal using the overloaded inequality operator.

Point3D point1 = new Point3D(10, 5, 1);
Point3D point2 = new Point3D(15, 40, 60);
Boolean areNotEqual;

areNotEqual = (point1 != point2);
// areNotEqual is True

// Displaying Results
syntaxString = "areNotEqual = (point1 != point2);";
resultType = "Boolean";
operationString = "Checking if two 3D points are not equal";
ShowResults(areNotEqual.ToString(), syntaxString, resultType, operationString);
' Checks if two Point3Ds are not equal using the overloaded inequality operator.

Dim point1 As New Point3D(10, 5, 1)
Dim point2 As New Point3D(15, 40, 60)
Dim areNotEqual As Boolean

areNotEqual = (point1 <> point2)
' areNotEqual is True

' Displaying Results
syntaxString = "areNotEqual = (point1 != point2)"
resultType = "Boolean"
operationString = "Checking if two 3D points are not equal"
ShowResults(areNotEqual.ToString(), syntaxString, resultType, operationString)

Comentarios

Dos Point3D estructuras no son iguales si los valores de sus Xpropiedades , Yy Z son diferentes.

Dado Double que los valores pueden perder precisión cuando se realizan operaciones aritméticas en ellos, es posible que se produzca un error en una comparación entre dos Point3D instancias que son lógicamente iguales.

Se aplica a