Vector2.Equals Method

Definition

Returns a value that indicates whether this instance and a specified Vector2 instance or a specified object are equal.

Overloads

Equals(Vector2)

Returns a value that indicates whether this instance and another vector are equal.

Equals(Object)

Returns a value that indicates whether this instance and a specified object are equal.

Equals(Vector2, Vector2)

Equals(Vector2)

Source:
Vector2.cs
Source:
Vector2.cs
Source:
Vector2.cs

Returns a value that indicates whether this instance and another vector are equal.

C#
public bool Equals(System.Numerics.Vector2 other);
C#
public readonly bool Equals(System.Numerics.Vector2 other);

Parameters

other
Vector2

The other vector.

Returns

true if the two vectors are equal; otherwise, false.

Implements

Remarks

Two vectors are equal if their X and Y elements are equal.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1
UWP 10.0

Equals(Object)

Source:
Vector2.cs
Source:
Vector2.cs
Source:
Vector2.cs

Returns a value that indicates whether this instance and a specified object are equal.

C#
public override bool Equals(object obj);
C#
public override readonly bool Equals(object? obj);
C#
public override readonly bool Equals(object obj);

Parameters

obj
Object

The object to compare with the current instance.

Returns

true if the current instance and obj are equal; otherwise, false. If obj is null, the method returns false.

Remarks

The current instance and obj are equal if obj is a Vector2 object and their X and Y elements are equal.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1
UWP 10.0

Equals(Vector2, Vector2)

C#
public static System.Numerics.Vector2 Equals(System.Numerics.Vector2 left, System.Numerics.Vector2 right);

Parameters

left
Vector2
right
Vector2

Returns

Applies to

.NET 10
Product Versions
.NET 10