---
title: "atan(): typeshade/core/ir의 IR 빌더 함수, TypeShade 컴파일러 API"
description: "atan, typeshade/core/ir의 IR 빌더 함수입니다. atan(x): 인수가 하나인 아크탄젠트입니다. 결과는 (-π/2, π/2) 범위의 라디안이며, 성분별로 계산합니다."
url: https://typeshade.dev/ko/api/atan/
language: ko
---

# `atan()`

함수, 내장 함수 분류

`atan(x)`: 인수가 하나인 아크탄젠트입니다. 결과는 (-π/2, π/2) 범위의 라디안이며, 성분별로 계산합니다.

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

이 export는 IR 노드를 반환합니다. `"use typeshade"` 파일에서는 내장 함수 자체를 부릅니다: [`atan()`](https://typeshade.dev/ko/reference/functions/atan/)

설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.

## 구문

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

## 매개변수

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

## 반환값

`Node<K>`

## 설명

`atan(x)`는 인수가 하나인 아크탄젠트입니다. 결과가 `(-π/2, π/2)` 범위의 라디안이며, 성분별로 계산합니다. 두 사분면만 다루므로, 두 인수 형태가 필요하면 [`atan2`](https://typeshade.dev/ko/api/atan2/)를 써야 합니다. 두 인수 형태는 `(y, x)` 쌍에서 전체 각을 구하며, 단순 비율이 버리는 부호 정보를 사용합니다.

## 예제

### 예제

```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)))
```

## 대상별 지원

| 대상 | 지원 | 비고 |
| --- | --- | --- |
| WGSL (WebGPU) | 지원 | `atan(x)`. |
| GLSL ES 3.00 (WebGL2) | 지원 | `atan(x)`. |
| CPU 오라클 | 지원 | 오라클이 `f64`로 계산합니다. |

## 함께 보기

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

## 소스

[`src/core/ir/node.ts`, 1163행](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L1163), 커밋 af54ddad5 기준
