Point3D.Equals Method (Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public override bool Equals(
	object o


Type: System.Object

The object to compare.

Return Value

Type: System.Boolean

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.

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.

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

.NET Framework
Available since 3.0
Return to top