---
title: "cross(): IR builder function in typeshade/core/ir, TypeShade"
description: "cross, an IR builder function in typeshade/core/ir. cross(a, b): 3-D cross product of two vec3<f32> values."
url: https://typeshade.dev/api/cross/
language: en
---

# `cross()`

Function in Builtins

`cross(a, b)`: 3-D cross product of two `vec3<f32>` values.

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

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

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

## Syntax

```ts
const cross: (
  a: ReadonlyNode<"vec3<f32>">,
  b: ReadonlyNode<"vec3<f32>">,
) => Node<"vec3<f32>">
```

## Parameters

**`a` `ReadonlyNode<'vec3<f32>'>`**

**`b` `ReadonlyNode<'vec3<f32>'>`**

## Return value

`Node<'vec3<f32>'>`

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | `cross(a, b)`. |
| GLSL ES 3.00 (WebGL2) | Supported | `cross(a, b)`. |
| CPU oracle | Supported | Evaluated in `f64` by the oracle. |

## See also

- [`cross()`](https://typeshade.dev/reference/functions/cross/)

## Source

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