I running a project and cant import numpy-quaternion on it. So i have to customize some function. One of them is np.slerp_vectorized. But when i search the formula and try to implement, it has a different result and i dont know if i was wrong or np.slerp_vectorized has a different formula. Here is the code:
import numpy as np
import quaternion
from pyquaternion import Quaternion
from scipy.spatial.transform import Slerp
origin = np.slerp_vectorized(quaternion.from_float_array([1,2,3,4]),quaternion.from_float_array([3,3,3,3]), 0.5)
def slerp_(q1, q2, t):
Q = ((q2*q1.inverse)**t)*q1
return np.array([Q[0],Q[1],Q[2],Q[3]])
# using pyquaternion
custom = slerp(Quaternion([1,2,3,4]), Quaternion([3,3,3,3]), 0.5)```
Im trying to get the same result with np.slerp_vectorized but i dont have its formula