text: import numpy as np
  
  
  def lerp(x, y, t):
      return (1-t)*x + t*y
  
  
  def slerp(x, y, t):
      omega = np.arccos(np.dot(x, y))
      if omega == 0 or np.isnan(omega):
          return x
      term_1 = x * np.sin((1-t)*omega)
      term_2 = y * np.sin(t*omega)
  
      return (term_1 + term_2) / np.sin(omega)
  