---
title: "asin(): IR builder function in typeshade/core/ir, TypeShade"
description: "asin, an IR builder function in typeshade/core/ir. asin(x): arcsine of x, returning radians in [-π/2, π/2], component-wise."
url: https://typeshade.dev/api/asin/
language: en
---

# `asin()`

Function in Builtins

`asin(x)`: arcsine of x, returning radians in \[-π/2, π/2\], component-wise.

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

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

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

## Syntax

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

## Parameters

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

## Return value

`Node<K>`

## Description

`x` outside `[-1, 1]` is undefined per the WGSL and GLSL specs (NaN on most drivers); [`clamp`](https://typeshade.dev/api/clamp/) the argument first when rounding can push it outside that range.

## Examples

### Example

```ts
import { fn, asin, clamp, f32T } from 'typeshade/core/ir'

const angle = fn('angle', { sinA: f32T }, ({ sinA }) => asin(clamp(sinA, -1, 1)))
```

## Targets

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

## See also

- [`asin()`](https://typeshade.dev/reference/functions/asin/)
- [`clamp`](https://typeshade.dev/api/clamp/)

## Source

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