# Sandbox.SandboxSystemExtensions.VectorInSquare

```csharp
static Vector2 VectorInSquare(System.Random self, float extents = 1)
```

Uniformly samples a 2D position from a square with coordinates in the range -`extents` to +`extents`.

### Parameters

- `self` (`System.Random`)
- `extents` (`float`), default `1`

### Returns

`Vector2`

Declared in [Sandbox.SandboxSystemExtensions](/api/Sandbox.SandboxSystemExtensions).
Assembly: `Sandbox.System`.
