slerp(from:to:t:along:)
Returns the spherical linear interpolation along either the shortest or the longest arc between two rotations.
Declaration
static func slerp(from: Rotation3D, to: Rotation3D, t: Double, along path: Rotation3D.SlerpPath = .shortest) -> Rotation3DParameters
- from:
The starting rotation.
- to:
The ending rotation.
- t:
The position along the interpolation that’s between
0and1. - path:
An enumeration that specifies whether the interpolation should be along the shortest or the longest path between the two rotations.
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.