# Vector2.DistanceSquared

## Overload 1

```csharp
static float DistanceSquared(in Vector2 a, in Vector2 b)
```

Returns squared distance between the 2 given vectors. This is faster than [DistanceBetween](/api/Vector2/DistanceBetween),
and can be used for things like comparing distances, as long as only squared values are used.

### Parameters

- `in a` (`Vector2`)
- `in b` (`Vector2`)

### Returns

`float`

## Overload 2

```csharp
float DistanceSquared(Vector2 target)
```

Returns squared distance between the 2 given vectors. This is faster than [Distance](/api/Vector2/Distance),
and can be used for things like comparing distances, as long as only squared values are used.

### Parameters

- `target` (`Vector2`)

### Returns

`float`

Declared in [Vector2](/api/Vector2).
Assembly: `Sandbox.System`.
