def slerp(R1, R2, t1, t2, t_out): """Spherical linear interpolation of rotors This function uses a simpler interface than the more fundamental `slerp_evaluate` and `slerp_vectorized` functions. The latter are fast, being implemented at the C level, but take input `tau` instead of time. This function adjusts the time accordingly. Parameters ---------- R1: quaternion Quaternion at beginning of interpolation R2: quaternion Quaternion at end of interpolation t1: float Time corresponding to R1 t2: float Time corresponding to R2 t_out: float or array of floats Times to which the rotors should be interpolated """ tau = (t_out-t1)/(t2-t1) return np.slerp_vectorized(R1, R2, tau)