---
title: "slerp(from:to:t:along:)"
framework: spatial
role: symbol
role_heading: Type Method
path: "spatial/rotation3d/slerp(from:to:t:along:)"
---

# slerp(from:to:t:along:)

Returns the spherical linear interpolation along either the shortest or the longest arc between two rotations.

## Declaration

```swift
static func slerp(from: Rotation3D, to: Rotation3D, t: Double, along path: Rotation3D.SlerpPath = .shortest) -> Rotation3D
```

## Parameters

- `from`: The starting rotation.
- `to`: The ending rotation.
- `t`: The position along the interpolation that’s between 0 and 1.
- `path`: An enumeration that specifies whether the interpolation should be along the shortest or the longest path between the two rotations.

## Return Value

Return Value A new rotation. When t = 0.0, the result is the from rotation. When t = 1.0, the result is the to rotation. For any other value of t, the result is a spherical linear interpolation between the two rotations.

## See Also

### Transforming a 3D rotation structure

- [Rotation3D.SlerpPath](spatial/rotation3d/slerppath.md)
- [inverse](spatial/rotation3d/inverse.md)
- [identity](spatial/rotation3d/identity.md)
