Vector3 { public double compare(Vector3 vect) { double quality = 0.0; quality += Math.abs(fX-vect.x())/Math.abs(fX); quality += Math.abs(fY-vect.y())/Math.abs(fY); quality += Math.abs(fZ-vect.z())/Math.abs(fZ); return quality; } Vector3(Vector3 v);  Vector3();  Vector3(double x, double y, double z); double x(); double y(); double z(); void setXYZ(double x, double y, double z); void rotateX(double angle); void rotateY(double angle); void rotateZ(double angle); void setMagThetaPhi(double mag, double theta , double phi); void setMag(double mag); double mag2(); double mag(); double rho(); double theta(); double phi(); void add(Vector3 vector); void negative(); void sub(Vector3 vector); double compare(Vector3 vect); double dot(Vector3 vect); Vector3 cross(Vector3 vect); double theta(Vector3 vect); void copy(Vector3 vect); void unit(); double compareWeighted(Vector3 vect); String getXYZString(); String getMagThetaPhiString(); @Override String toString();  }
@Test public void testCompare() { Vector3 v1 = new Vector3(1, 2, 3); Vector3 v2 = new Vector3(1, 2, 3); assertEquals(v1.compare(v2), 0.0, 1e-6); assertEquals(v1.compareWeighted(v2), 0.0, 1e-6); }