Astronomical { static double altitudeOfCelestialBody(double φ, double δ, double H) { final double term1 = Math.sin(Math.toRadians(φ)) * Math.sin(Math.toRadians(δ)); final double term2 = Math.cos(Math.toRadians(φ)) * Math.cos(Math.toRadians(δ)) * Math.cos(Math.toRadians(H)); return Math.toDegrees(Math.asin(term1 + term2)); }    }
@Test public void testAltitudeOfCelestialBody() { final double φ = 38 + (55 / 60.0) + (17.0 / 3600); final double δ = -6 - (43 / 60.0) - (11.61 / 3600); final double H = 64.352133; final double h = Astronomical.altitudeOfCelestialBody( φ, δ, H); assertThat(h).isWithin(0.0001).of(15.1249); }