RobotController { static float computeAngle (double x,double y) { double theta = Math.atan2(y,x) ; if (theta<0){ theta=2*Math.PI+theta; } return (float)( (theta * 180 / Math.PI) % 360); } RobotController(@NonNull ConvenienceRobot robot, @NonNull EventBus bus, @NonNull ColorMap colorMap); void unlink(); @Subscribe synchronized void updateAccelerometer(MuseHandler.AccelerometerReading reading); @Subscribe synchronized void updateConcentration(MuseHandler.FocusReading reading); void setColorMap(ColorMap colorMap); void setOverrideFocus(boolean overrideFocus); void setBaseReading(); void setOverrideValue(double overrideValue); void setMaximumTrust(double maximumTrust); void setCalibrating(boolean isCalibrating); boolean isCalibrating(); void setPanicModeEnabled(boolean enablePanicMode); boolean isPanicModeEnabled();  }
@Test public void computeAngle(){ double angle = RobotController.computeAngle(1.0,0.); assertEquals("(1,0) is 0 deg",angle,0.,0.); angle = RobotController.computeAngle(0,1.); assertEquals("(0,1) is 270 deg",angle,90.,0.); angle = RobotController.computeAngle(-1,.0); assertEquals("(-1,0) is 180 deg",angle,180.,0.); angle = RobotController.computeAngle(0,-1.); assertEquals("For (0,-1) the angle is 90.",angle,270.,0.); }