public static void main(String[] args) { Word w1=new Word(2,5); Word w2=new Word(1,5); Word w3=new Word(2,4); System.out.println(Math.signum(getStandardDeviation(w1, w3))==Math.signum(getStandardDeviation(w2, w3))); } public static double getStandardDeviation(Word word1,Word word2) { int b1,b2,f1,f2; double average1,average2, result1,result2; b1 = word1.getAttr1(); b2 = word2.getAttr1(); f1 = word1.getAttr2(); f2 = word2.getAttr2(); average1 = (b1-f1)/2; average2 = (b2-f2)/2; result1 = Math.sqrt((Math.pow(b1-average1,2)+Math.pow(f1-average1,2))/2); result2 = Math.sqrt((Math.pow(b2-average2,2)+Math.pow(f2-average2,2))/2); return (int)(result1 - result2); }