แก้ไข

แชร์ผ่าน


Point3D.Equals Method

Definition

Compares two Point3D structures for equality.

Overloads

Equals(Object)

Determines whether the specified object is a Point3D structure and if so, whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Point3D structure.

Equals(Point3D)

Compares two Point3D structures for equality.

Equals(Point3D, Point3D)

Compares two Point3D structures for equality.

Equals(Object)

Determines whether the specified object is a Point3D structure and if so, whether the X, Y, and Z properties of the specified Object are equal to the X, Y, and Z properties of this Point3D structure.

public:
 override bool Equals(System::Object ^ o);
public override bool Equals (object o);
override this.Equals : obj -> bool
Public Overrides Function Equals (o As Object) As Boolean

Parameters

o
Object

The object to compare.

Returns

true if the instances are equal; otherwise, false.

true if o is a Point3D structure and if it is also identical to this Point3D structure; otherwise, false.

Examples

The following example shows how to check whether an object and Point3D structure are equal.

// Compares an Object and a Point3D for equality using the non-static Equals method.

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

areEqual = point1.Equals(point2);
// areEqual is False.  point2 is a Point3D structure, but it is not equal to point1.	

// Displaying Results
syntaxString = "areEqual = point1.Equals(point2);;";
resultType = "Boolean";
operationString = "Checking if two 3D points are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
' Compares an Object and a Point3D for equality using the non-static Equals method.

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

areEqual = point1.Equals(point2)
' areEqual is False.  point2 is a Point3D structure, but it is not equal to point1.	


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

Remarks

If o is not a Point3D structure, this method returns false.

Because Double values can lose precision when arithmetic operations are performed on them, a comparison between two Point3D instances that are logically equal might fail.

See also

Applies to

Equals(Point3D)

Compares two Point3D structures for equality.

public:
 bool Equals(System::Windows::Media::Media3D::Point3D value);
public bool Equals (System.Windows.Media.Media3D.Point3D value);
override this.Equals : System.Windows.Media.Media3D.Point3D -> bool
Public Function Equals (value As Point3D) As Boolean

Parameters

value
Point3D

The instance of Point3D to compare to this instance.

Returns

true if instances are equal; otherwise, false.

Remarks

Because Double values can lose precision when arithmetic operations are performed on them, a comparison between two Point3D instances that are logically equal might fail.

See also

Applies to

Equals(Point3D, Point3D)

Compares two Point3D structures for equality.

public:
 static bool Equals(System::Windows::Media::Media3D::Point3D point1, System::Windows::Media::Media3D::Point3D point2);
public static bool Equals (System.Windows.Media.Media3D.Point3D point1, System.Windows.Media.Media3D.Point3D point2);
static member Equals : System.Windows.Media.Media3D.Point3D * System.Windows.Media.Media3D.Point3D -> bool
Public Shared Function Equals (point1 As Point3D, point2 As Point3D) As Boolean

Parameters

point1
Point3D

The first Point3D structure to compare.

point2
Point3D

The second Point3D structure to compare.

Returns

true if the X, Y, and Z values for point1 and point2 are equal; otherwise, false.

Examples

The following example shows how to check whether two Point3D structures are equal.

// Checks if two Point3D structures are equal using the static Equals method.
 
Point3D point1 = new Point3D(10, 5, 1);
Point3D point2 = new Point3D(15, 40, 60);
Boolean areEqual;

areEqual = Point3D.Equals(point1, point2);
// areEqual is False	

//Displaying Results
syntaxString = "areEqual = Point3D.Equals(point1, point2);";
resultType = "Boolean";
operationString = "Checking if 3D two points are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
' Checks if two Point3D structures are equal using the static Equals method.

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

areEqual = Point3D.Equals(point1, point2)
' areEqual is False	

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

Remarks

Two Point3D structures are equal if the values of their X, Y, and Z properties are the same.

Because Double values can lose precision when arithmetic operations are performed on them, a comparison between two Point3D instances that are logically equal might fail.

See also

Applies to