# Distance

> Calculates the distance between two given vectors.

## Definition

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

## Distance(Vector3Int, Vector3Int)

Calculates the distance between two given vectors.

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

### Parameters

**** (\[Vector3Int]\(/engine/6000.7/script-reference/unityengine/vector3int)): The first vector to check.**** (\[Vector3Int]\(/engine/6000.7/script-reference/unityengine/vector3int)): The second vector to check.

### Returns

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

### Remarks

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

## Distance(Vector3Int, Vector3Int)

Calculates the distance between two given vectors.

```csharp
public static float Distance(in Vector3Int a, in Vector3Int b)
```

### Parameters

**** (\[Vector3Int]\(/engine/6000.7/script-reference/unityengine/vector3int)): The first vector to check.**** (\[Vector3Int]\(/engine/6000.7/script-reference/unityengine/vector3int)): The second vector to check.

### Returns

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

### Remarks

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