Location { public static double clampLatitude(double degrees) { return degrees > 90 ? 90 : (degrees < -90 ? -90 : degrees); } Location();  Location(double latitude, double longitude);  Location(Location location); static Location fromDegrees(double latitudeDegrees, double longitudeDegrees); static Location fromRadians(double latitudeRadians, double longitudeRadians); static Location fromTimeZone(TimeZone timeZone); static double normalizeLatitude(double degrees); static double normalizeLongitude(double degrees); static double clampLatitude(double degrees); static double clampLongitude(double degrees); static boolean locationsCrossAntimeridian(List<? extends Location> locations); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Location set(double latitude, double longitude); Location set(Location location); Location interpolateAlongPath(Location endLocation, @WorldWind.PathType int pathType, double amount,
                                         Location result); double greatCircleAzimuth(Location location); double greatCircleDistance(Location location); Location greatCircleLocation(double azimuthDegrees, double distanceRadians, Location result); double rhumbAzimuth(Location location); double rhumbDistance(Location location); Location rhumbLocation(double azimuthDegrees, double distanceRadians, Location result); double linearAzimuth(Location location); double linearDistance(Location location); Location linearLocation(double azimuthDegrees, double distanceRadians, Location result); public double latitude; public double longitude; }
@Test public void testClampLatitude() throws Exception { assertEquals("0", 0.0, Location.clampLatitude(0.0), 0); assertEquals("THETA", THETA, Location.clampLatitude(THETA), 0); assertEquals("-THETA", -THETA, Location.clampLatitude(-THETA), 0); assertEquals("90", 90.0, Location.clampLatitude(90.0), 0); assertEquals("-90", -90.0, Location.clampLatitude(-90.0), 0); assertEquals("91", 90.0, Location.clampLatitude(91.0), 0); assertEquals("-91", -90.0, Location.clampLatitude(-91.0), 0); }