---
title: "mat2f64(): IR builder function in typeshade/core/ir"
description: "mat2f64, an IR builder function in typeshade/core/ir. An emulated-double mat2x2<f64> constructor, column-major: one vec2<f64> argument per column…"
url: https://typeshade.dev/api/mat2f64/
language: en
---

# `mat2f64()`

Function in Builtins

An emulated-double `mat2x2<f64>` constructor, column-major: one `vec2<f64>` argument per column, the same convention as WGSL's `mat2x2`.

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

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

## Syntax

```ts
const mat2f64: (
  cols_0: Mat64Col<2>,
  cols_1: Mat64Col<2>,
) => Node<"mat2x2<f64>">
```

## Parameters

**`...cols` `[Mat64Col<2>, Mat64Col<2>]`**

## Return value

`Node<'mat2x2<f64>'>`

## Description

Use [`transformMat64`](https://typeshade.dev/api/transformmat64/) and [`mulMat64`](https://typeshade.dev/api/mulmat64/) for the `f64` matrix-vector and matrix-matrix products; the generic `.mul` rejects a matrix operand.

## Examples

### Example

```ts
import { mat2f64, vec2f64 } from 'typeshade/core/ir'

const m = mat2f64(vec2f64(1, 2), vec2f64(3, 4))  // Node<'mat2x2<f64>'>
```

## See also

- [`transformMat64`](https://typeshade.dev/api/transformmat64/)
- [`mulMat64`](https://typeshade.dev/api/mulmat64/)

## Source

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