---
title: "crescent"
description: "A crescent: a disc with a smaller disc bitten out of it."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "shape"
categorySlug: "shape"
categoryTitle: "Shapes"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/shape.ts#L186"
---

# crescent

A crescent: a disc with a smaller disc bitten out of it.

```ts
crescent(x: Val, y: Val, outerRadius: Val, innerRatio: Val, offset: Val): Expr
```

Import `shape` from `shaders/std` and use `shape.crescent`.

`outerRadius` is the full disc's radius, in uv. `innerRatio` (0–1) is the bite's radius as a fraction of it. `offset` is how far the bite's centre is shifted sideways, in uv.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `x` | `Val` |  |
| `y` | `Val` |  |
| `outerRadius` | `Val` |  |
| `innerRatio` | `Val` |  |
| `offset` | `Val` |  |

## Example

```ts
shape: {distance: ({x, y}, u) => crescent(x, y, u('radius'), u('innerRatio'), u('offset')), …}
```

## See also

- [`ring`](/docs/primitives/shape/ring) — A ring: a circular band around a centre.
- [`vesica`](/docs/primitives/shape/vesica) — A vesica: the lens where two equal circles overlap.

## Used by

[Crescent](/docs/components/crescent)