# distanceTo

function in `@dioramajs/blocks/glow`

```ts
import { distanceTo } from '@dioramajs/blocks/glow'
```

Distance in px from a point to a box, 0 inside.

```ts
function distanceTo(
  p: Point,
  x: number,
  y: number,
  width: number,
  height: number,
): number
```

| Parameter | Type | Description |
| --- | --- | --- |
| `p` | `Point` |  |
| `x` | `number` |  |
| `y` | `number` |  |
| `width` | `number` |  |
| `height` | `number` |  |

Defined in [packages/blocks/src/glow.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/blocks/src/glow.ts#L54).
