docs: public static double Cosine(double[] p, double[] q) {
          double sumProduct = 0;
          double sumP = 0, sumQ = 0;
  
          for (int i = 0; i < p.length; i++) {
              sumProduct += p[i] * q[i];
              sumP += Math.pow(Math.abs(p[i]), 2);
              sumQ += Math.pow(Math.abs(q[i]), 2);
          }
  
          sumP = Math.sqrt(sumP);
          sumQ = Math.sqrt(sumQ);
  
          double result = 1 - (sumProduct / (sumP * sumQ));
  
          return result;
      }