# Function: bounds()

[**lifecycle-kit**](https://jonbogaty.com/lifecycle-kit/api/readme/index.md)

***

[lifecycle-kit](https://jonbogaty.com/lifecycle-kit/api/readme/index.md) / [forms](https://jonbogaty.com/lifecycle-kit/api/forms/readme/index.md) / bounds


# Function: bounds() {#function-bounds}


> **bounds**(`path`): \{ `max`: [`Vec2`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/vec2/index.md); `min`: [`Vec2`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/vec2/index.md); \} \| `null`

Defined in: [forms/path.ts:410](https://github.com/jbcom/lifecycle-kit/blob/074e4e7b8038d3e2de9eb44c4b5b5aee0ef02b48/src/forms/path.ts#L410)

The bounding box of a path, or `null` when it has no shapes.

Exact for every member of the segment vocabulary, which is the reason it is
here rather than in a renderer. Tests assert extents — "a taper narrows",
"a radiate is symmetric about its hub" — and an approximate bound computed
from control points would make those assertions fuzzy in precisely the way
vectors were chosen to avoid.

Control points of a Bézier are NOT on the curve, so including them directly
would overstate the box. The curve is solved instead: the extremum of a
Bézier lies at an endpoint or where its derivative crosses zero, so the
derivative roots within (0, 1) are evaluated and included.


## Parameters {#parameters}



### path {#path}


[`Path`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/path/index.md)


## Returns {#returns}


\{ `max`: [`Vec2`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/vec2/index.md); `min`: [`Vec2`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/vec2/index.md); \} \| `null`
