---
name: "quat_slerp"
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_slerp/3alleg4"
---

# quat\_slerp(3alleg4)

Version of quat\_interpolate() allowing control over the rotation. Allegro game programming library.

## NAME

quat\_slerp - Version of quat\_interpolate() allowing control over the rotation. Allegro game programming library.

## SYNOPSIS

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

**void quat\_slerp(const QUAT \*from, const QUAT \*to, float t, QUAT \*out, int how);**

## DESCRIPTION

The same as quat\_interpolate(), but allows more control over how the  rotation is done. The how parameter can be any one of the values:

```
   QUAT_SHORT  - like quat_interpolate(), use shortest path
   QUAT_LONG   - rotation will be greater than 180 degrees
   QUAT_CW     - rotate clockwise when viewed from above
   QUAT_CCW    - rotate counterclockwise when viewed from above
   QUAT_USER   - the quaternions are interpolated exactly as
                 given
```
