Upravit

Sdílet prostřednictvím


Point4D.Equals Method

Definition

Compares two Point4D structures for equality.

Overloads

Equals(Object)

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

Equals(Point4D)

Compares two Point4D structures for equality.

Equals(Point4D, Point4D)

Compares two Point4D structures for equality.

Equals(Object)

Determines whether the specified Object is a Point4D structure and if the X, Y, Z, and W properties of the specified Object are equal to the X, Y, Z, and W properties of this Point4D 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 instances are equal; otherwise, false.

true if o (the passed Object) is a Point4D structure and is identical with this Point4D structure; false otherwise.

Examples

The following example shows how to check whether an Object and a Point4D structure are equal.

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

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

areEqual = point1.Equals(point2);
// areEqual is False.  point2 is a Point4D 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 Point4D for equality using the non-static Equals method.

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

areEqual = point1.Equals(point2)
' areEqual is False.  point2 is a Point4D 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 (the passed object) is not a Point4D structure, this method returns false.

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

See also

Applies to

Equals(Point4D)

Compares two Point4D structures for equality.

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

Parameters

value
Point4D

The instance of Point4D to compare to this instance.

Returns

true if instances are equal; otherwise, false.

Remarks

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

See also

Applies to

Equals(Point4D, Point4D)

Compares two Point4D structures for equality.

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

Parameters

point1
Point4D

The first Point4D structure to compare.

point2
Point4D

The second Point4D structure to compare.

Returns

true if the X, Y, and Z components of point3D1 and point3D2 are equal; false otherwise.

Examples

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

// Checks if two Point4D structures are equal using the static Equals method.
 
// point1's x,y,z,w properties set when the structure is created  
Point4D point1 = new Point4D(10, 5, 1, 4);

Point4D point2 = new Point4D();
Boolean areEqual;

// settting point2's x,y,z,w properties   
point2.X = 15;
point2.Y = 40;
point2.Z = 60;
point2.W = 75;

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

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

' point1's x,y,z,w properties set when the structure is created  
Dim point1 As New Point4D(10, 5, 1, 4)

Dim point2 As New Point4D()
Dim areEqual As Boolean

' settting point2's x,y,z,w properties   
point2.X = 15
point2.Y = 40
point2.Z = 60
point2.W = 75

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

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

Remarks

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

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

See also

Applies to