code: public Quaterniond slerp(Quaterniondc target, double alpha, Quaterniond dest) {
          double cosom = x * target.x() + y * target.y() + z * target.z() + w * target.w();
          double absCosom = Math.abs(cosom);
          double scale0, scale1;
          if (1.0 - absCosom > 1E-6) {
              double sinSqr = 1.0 - absCosom * absCosom;
              double sinom = 1.0 / Math.sqrt(sinSqr);
              double omega = Math.atan2(sinSqr * sinom, absCosom);
              scale0 = Math.sin((1.0 - alpha) * omega) * sinom;
              scale1 = Math.sin(alpha * omega) * sinom;
          } else {
              scale0 = 1.0 - alpha;
              scale1 = alpha;
          }
          scale1 = cosom >= 0.0 ? scale1 : -scale1;
          dest.x = scale0 * x + scale1 * target.x();
          dest.y = scale0 * y + scale1 * target.y();
          dest.z = scale0 * z + scale1 * target.z();
          dest.w = scale0 * w + scale1 * target.w();
          return dest;
      }
docs: /* (non-Javadoc)
  @see org.joml.Quaterniondc#slerp(org.joml.Quaterniondc, double, org.joml.Quaterniond)