다음을 통해 공유


Point3D.Inequality(Point3D, Point3D) 연산자

정의

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

매개 변수

point1
Point3D

비교할 첫 번째 Point3D 구조체입니다.

point2
Point3D

비교할 두 번째 Point3D 구조체입니다.

반환

Boolean

point1point2X, YZ 좌표가 서로 다르면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 오버로드된 같지 않음 연산자를 사용하여 두 Point3D 구조체가 같지 않은지 확인하는 방법을 보여 줍니다.

// 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)

설명

Point3D 구조체의 XY값이 다르고 Z 속성이 다르면 같지 않습니다.

산술 연산을 수행할 때 값이 정밀도를 잃을 수 있으므로 Double 논리적으로 같은 두 Point3D 인스턴스를 비교하지 못할 수 있습니다.

적용 대상