# Distance(Vector2Int, Vector2Int)

> Calculates the distance between two vectors.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static float Distance(Vector2Int a, Vector2Int b)
```

### Parameters

**** (\[Vector2Int]\(/engine/6000.0/script-reference/unityengine/vector2int)): The first vector to check.**** (\[Vector2Int]\(/engine/6000.0/script-reference/unityengine/vector2int)): The second vector to check.

### Returns

| Type                                                          | Description                       |
| ------------------------------------------------------------- | --------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The distance between `a` and `b`. |

### Remarks

`Vector2.Distance(a,b)` is the same as `(a-b).magnitude`.
