FuAlgo { double getHue(double chrX, double chrY) { double atan2 = Math.atan2((chrY - CONST_WHITE_POINT), (chrX - CONST_WHITE_POINT)); final double hue = (180 * atan2) / Math.PI; return hue < 0 ? hue + 360 : hue; } FuAlgo(Instrument instrument);   FuAlgo(); FuResult compute(double[] spectrum); static final byte MAX_FU_VALUE; }
@Test public void testGetHueValue() throws Exception { assertEquals(225.0, fuAlgo.getHue(0.0, 0.0), 1e-8); assertEquals(50.52753979724931, fuAlgo.getHue(5, 6), 1e-8); assertEquals(37.4570178393783, fuAlgo.getHue(40.1, 30.8), 1e-8); }