다음을 통해 공유


Point3D.Equality(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 ( = ) : 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 equal using the overloaded equality operator.

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

areEqual = (point1 == point2);
// areEqual is False

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

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

areEqual = (point1 = point2)
' areEqual is False

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

설명

Point3D 구조체는 해당 X구조 Y 체의 값과 Z 속성이 같으면 같습니다.

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

적용 대상

추가 정보