---
title: "circle"
description: "A circle of a given radius."
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#L44"
---

# circle

A circle of a given radius.

```ts
circle(x: Val, y: Val, radius: Val): Expr
```

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

`radius` is in uv (1 = the canvas height). Returns the signed distance to the edge, negative inside.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `x` | `Val` |  |
| `y` | `Val` |  |
| `radius` | `Val` |  |

## Example

```ts
shape: {distance: ({x, y}, u) => circle(x, y, u('radius')), bounds: {size: {width: 'radius', height: 'radius'}}, …}
```

> **Tip.** Blend a sharp shape toward this one with `math.mix` to round it off (the Polygon shader does).

## See also

- [`ellipse`](/docs/primitives/shape/ellipse) — An ellipse with separate horizontal and vertical radii.
- [`ring`](/docs/primitives/shape/ring) — A ring: a circular band around a centre.
- [`polygon`](/docs/primitives/shape/polygon) — A regular polygon with any number of sides.

## Used by

[Circle](/docs/components/circle), [Polygon](/docs/components/polygon), [Waveform](/docs/components/waveform)