> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::interpolate

> Interpolate between two 2D rotations.

#### Interpolate between two 2D rotations

```cpp showLineNumbers={false}
template <typename K>
SO2<K> holoscan::interpolate(
    K p,
    const SO2<K> &a,
    const SO2<K> &b
)
```

Interpolate between two 2D rotations.

Due to the nature of rotations this function is problematic if the two rotations are about 180 degrees apart. In that case small deviations in the input may have large deviations in the output.

**Returns:** Interpolated rotation.

**Template parameters**

**`K`** `typename`

Scalar type.

---

**Parameters**

**`p`** `K`

Interpolation parameter (0.0 returns a, 1.0 returns b).

---

**`a`** `const SO2<K> &`

First rotation.

---

**`b`** `const SO2<K> &`

Second rotation.

---

#### Overload 2

```cpp showLineNumbers={false}
template <typename K>
SO3<K> holoscan::interpolate(
    K p,
    const SO3<K> &a,
    const SO3<K> &b
)
```

Interpolate between two 3D rotations using spherical linear interpolation (slerp).

**Returns:** Interpolated rotation using quaternion slerp.

**Template parameters**

**`K`** `typename`

Scalar type.

---

**Parameters**

**`p`** `K`

Interpolation parameter (0.0 returns a, 1.0 returns b).

---

**`a`** `const SO3<K> &`

First rotation.

---

**`b`** `const SO3<K> &`

Second rotation.

---

#### Overload 3

```cpp showLineNumbers={false}
template <typename K>
Pose2<K> holoscan::interpolate(
    K p,
    const Pose2<K> &a,
    const Pose2<K> &b
)
```

Interpolate between two 2D poses using independent interpolation.

This uses "independent" interpolation of translation and rotation. This is only one of multiple ways to interpolate between two rigid body poses.

**Returns:** Interpolated pose.

**Template parameters**

**`K`** `typename`

Scalar type.

---

**Parameters**

**`p`** `K`

Interpolation parameter (0.0 returns a, 1.0 returns b).

---

**`a`** `const Pose2<K> &`

First pose.

---

**`b`** `const Pose2<K> &`

Second pose.

---

#### Overload 4

```cpp showLineNumbers={false}
template <typename K>
Pose3<K> holoscan::interpolate(
    K p,
    const Pose3<K> &a,
    const Pose3<K> &b
)
```

Interpolate between two 3D poses using independent interpolation.

This uses "independent" interpolation of translation and rotation. This is only one of multiple ways to interpolate between two rigid body poses.

**Returns:** Interpolated pose.

**Template parameters**

**`K`** `typename`

Scalar type.

---

**Parameters**

**`p`** `K`

Interpolation parameter (0.0 returns a, 1.0 returns b).

---

**`a`** `const Pose3<K> &`

First pose.

---

**`b`** `const Pose3<K> &`

Second pose.

---