---
name: "quat_mul"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/quat_mul/3alleg4"
---

# quat\_mul(3alleg4)

Multiplies two quaternions. Allegro game programming library.

## NAME

quat\_mul - Multiplies two quaternions. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**void quat\_mul(const QUAT \*p, const QUAT \*q, QUAT \*out);**

## DESCRIPTION

Multiplies two quaternions, storing the result in out. The resulting  quaternion will have the same effect as the combination of p and q, ie.  when applied to a point, (point \* out) = ((point \* p) \* q). Any number of  rotations can be concatenated in this way. Note that quaternion  multiplication is not commutative, ie. quat\_mul(p, q) != quat\_mul(q, p).
