public double convertAzimuth2xaxisAngle(double azimuth) {
        if (Double.compare(azimuth, 360) > 0 || Double.compare(azimuth, 0) < 0) {
            throw new IllegalArgumentException("Azimuth " + azimuth + " must be in (0, 360)");
        }
        double angleXY = PI_2 - azimuth / 180. * Math.PI;
        if (angleXY < -Math.PI)
            angleXY += 2 * Math.PI;
        if (angleXY > Math.PI)
            angleXY -= 2 * Math.PI;
        return angleXY;
    }
@Test
    public void testConvertAzimuth2xAxisAngle() {
        assertEquals(Math.PI / 2, AC.convertAzimuth2xaxisAngle(0), 1E-6);
        assertEquals(Math.PI / 2, Math.abs(AC.convertAzimuth2xaxisAngle(360)), 1E-6);
        assertEquals(0, AC.convertAzimuth2xaxisAngle(90), 1E-6);
        assertEquals(-Math.PI / 2, AC.convertAzimuth2xaxisAngle(180), 1E-6);
        assertEquals(Math.PI, Math.abs(AC.convertAzimuth2xaxisAngle(270)), 1E-6);
        assertEquals(-3 * Math.PI / 4, AC.convertAzimuth2xaxisAngle(225), 1E-6);
        assertEquals(3 * Math.PI / 4, AC.convertAzimuth2xaxisAngle(315), 1E-6);
    }