@Test public void test3(){ double[] v1 = new double[]{248.124,-321.574,788.14,0.001,-459.298}; double[] v2 = new double[]{97.145,-78.658,417.0004,-4.02,-7865.3594}; Asserts.assertEqualLength(v1, v2); double res = Orloci.distance(v1, v2); Asserts.assertEquals(res, 0.99264848216636084272); }
public static double distance(double[] v1,double[] v2){ Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return Math.sqrt(2*(1-CommonStats.dotProduct(v1, v2)/(CommonStats.norm(v1)*CommonStats.norm(v2)))); }
Orloci { public static double distance(double[] v1,double[] v2){ Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return Math.sqrt(2*(1-CommonStats.dotProduct(v1, v2)/(CommonStats.norm(v1)*CommonStats.norm(v2)))); } }
Orloci { public static double distance(double[] v1,double[] v2){ Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return Math.sqrt(2*(1-CommonStats.dotProduct(v1, v2)/(CommonStats.norm(v1)*CommonStats.norm(v2)))); }  }
Orloci { public static double distance(double[] v1,double[] v2){ Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return Math.sqrt(2*(1-CommonStats.dotProduct(v1, v2)/(CommonStats.norm(v1)*CommonStats.norm(v2)))); }  static double distance(double[] v1,double[] v2); }
Orloci { public static double distance(double[] v1,double[] v2){ Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return Math.sqrt(2*(1-CommonStats.dotProduct(v1, v2)/(CommonStats.norm(v1)*CommonStats.norm(v2)))); }  static double distance(double[] v1,double[] v2);  }