---
title: "atan(): IR builder function in typeshade/core/ir, TypeShade"
description: "atan, an IR builder function in typeshade/core/ir. atan(x): single-argument arctangent, returning radians in (-π/2, π/2), component-wise."
url: https://typeshade.dev/api/atan/
language: en
---

# `atan()`

Function in Builtins

`atan(x)`: single-argument arctangent, returning radians in (-π/2, π/2), component-wise.

`import { atan } from 'typeshade/core/ir'`

This export returns an IR node. A `"use typeshade"` file calls the builtin itself: [`atan()`](https://typeshade.dev/reference/functions/atan/)

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
const atan: <K extends FloatKey>(x: ReadonlyNode<K>) => Node<K>
```

## Parameters

**`x` `ReadonlyNode<K>`**

## Return value

`Node<K>`

## Description

`atan(x)`: single-argument arctangent, returning radians in `(-π/2, π/2)`, component-wise. It covers two quadrants only; use [`atan2`](https://typeshade.dev/api/atan2/) for the two-argument form, which recovers the full angle from a `(y, x)` pair with the sign information a plain ratio drops.

## Examples

### Example

```ts
import { fn, atan, exp, f32T } from 'typeshade/core/ir'

// The Gudermannian function, 2·atan(exp(y)) − π/2, is built on atan(exp(y)).
const gudermannian = fn('gud', { y: f32T }, ({ y }) => atan(exp(y)))
```

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | `atan(x)`. |
| GLSL ES 3.00 (WebGL2) | Supported | `atan(x)`. |
| CPU oracle | Supported | Evaluated in `f64` by the oracle. |

## See also

- [`atan()`](https://typeshade.dev/reference/functions/atan/)
- [`atan2`](https://typeshade.dev/api/atan2/)

## Source

[`src/core/ir/node.ts`, line 1163](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L1163), at commit af54ddad5
