Location { public static double clampLongitude(double degrees) { return degrees > 180 ? 180 : (degrees < -180 ? -180 : 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 testClampLongitude() throws Exception { assertEquals("0", 0.0, Location.clampLongitude(0.0), 0); assertEquals("PHI", PHI, Location.clampLongitude(PHI), 0); assertEquals("-PHI", -PHI, Location.clampLongitude(-PHI), 0); assertEquals("180", 180.0, Location.clampLongitude(180.0), 0); assertEquals("-180", -180.0, Location.clampLongitude(-180.0), 0); assertEquals("181", 180.0, Location.clampLongitude(181.0), 0); assertEquals("-181", -180.0, Location.clampLongitude(-181.0), 0); }