Point4D.Equals 方法

定义

比较两个 Point4D 结构是否相等。Compares two Point4D structures for equality.

重载

Equals(Object)

确定指定的 Object 是否为 Point4D 结构,以及指定的 ObjectXYZW 属性是否与此 Point4D 结构的 XYZW 属性相等。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)

比较两个 Point4D 结构是否相等。Compares two Point4D structures for equality.

Equals(Point4D, Point4D)

比较两个 Point4D 结构是否相等。Compares two Point4D structures for equality.

Equals(Object)

确定指定的 Object 是否为 Point4D 结构,以及指定的 ObjectXYZW 属性是否与此 Point4D 结构的 XYZW 属性相等。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

参数

o
Object

要比较的对象。The object to compare.

返回

Boolean

如果两个实例相等,则为 true;否则为 falsetrue if instances are equal; otherwise, false.

如果 o(传递的 Object)为 Point4D 结构并且与此 Point4D 结构相同,则为 true;否则为 falsetrue if o (the passed Object) is a Point4D structure and is identical with this Point4D structure; false otherwise.

示例

下面的示例演示如何检查 ObjectPoint4D 结构是否相等。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)

注解

如果 o (传递的对象) 不是 Point4D 结构,则此方法返回 falseIf o (the passed object) is not a Point4D structure, this method returns false.

由于 Double 值在对其执行算术运算时可能会丢失精度,因此,逻辑上相等的两个值之间的比较 Point4D 可能会失败。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.

另请参阅

适用于

Equals(Point4D)

比较两个 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

参数

value
Point4D

要与此实例比较的 Point4D 实例。The instance of Point4D to compare to this instance.

返回

Boolean

如果两个实例相等,则为 true;否则为 falsetrue if instances are equal; otherwise, false.

注解

由于 Double 值在对其执行算术运算时可能会丢失精度,因此,逻辑上相等的两个值之间的比较 Point4D 可能会失败。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.

另请参阅

适用于

Equals(Point4D, 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

参数

point1
Point4D

要比较的第一个 Point4D 结构。The first Point4D structure to compare.

point2
Point4D

要比较的第二个 Point4D 结构。The second Point4D structure to compare.

返回

Boolean

如果 point3D1point3D2XYZ 分量相等,则为 true;否则为 falsetrue if the X, Y, and Z components of point3D1 and point3D2 are equal; false otherwise.

示例

下面的示例演示如何检查两个 Point4D 结构是否相等。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)

注解

如果两个 Point4D 结构的 X 、、 Y 和属性的值 Z 相同,则这两个结构相等 WTwo Point4D structures are equal if the values of their X, Y, Z, and W properties are the same.

由于 Double 值可能会在对它们执行算术运算时丢失精度,因此,逻辑上相等的两个实例之间的比较 Point4D 可能会失败。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.

另请参阅

适用于