Geo { public static double degreesLonToMetersAtLat(final double lonDegrees, final double lat) { return lonDegrees * METERS_PER_DEGREE_LON_EQUATOR * Math.cos(Math.toRadians(lat)); } private  Geo(); @Nonnull static GeoRectangle grow(@Nullable final GeoRectangle rectangle, @Nonnull final GeoPoint point); static double degreesLatToMeters(final double latDegrees); static double degreesLonToMetersAtLat(final double lonDegrees, final double lat); static double metersToDegreesLat(final double northMeters); static double metersToDegreesLonAtLat(final double eastMeters, final double lat); static double distanceInMeters(@Nonnull final GeoPoint p1, @Nonnull final GeoPoint p2); static double mapToLat(final double lat); static double mapToLon(final double value); @Nonnull static Duration estimatedMinTravelTime(
            @Nonnull final GeoPoint from,
            @Nonnull final GeoPoint to); @Nonnull static Duration estimatedMinTravelTime(
            @Nonnull final GeoPoint from,
            @Nonnull final GeoPoint to,
            final int roundToMeters); static final double EARTH_RADIUS_X_METERS; static final double EARTH_RADIUS_Y_METERS; static final double EARTH_CIRCUMFERENCE_X; static final double EARTH_CIRCUMFERENCE_Y; static final double METERS_PER_DEGREE_LAT; static final double METERS_PER_DEGREE_LON_EQUATOR; static final double LON180; }
@Test public void testDegreesLonToMeters() { LOG.info("testDegreesLonToMeters"); assertEquals(0, compare(0, degreesLonToMetersAtLat(0, 0))); assertEquals(0, compare(METERS_PER_DEGREE_LON_EQUATOR / 2.0, degreesLonToMetersAtLat(0.5, 0))); assertEquals(0, compare(METERS_PER_DEGREE_LON_EQUATOR, degreesLonToMetersAtLat(1, 0))); assertEquals(0, compare(METERS_PER_DEGREE_LON_EQUATOR * 180, degreesLonToMetersAtLat(180, 0))); assertEquals(0, compare(-METERS_PER_DEGREE_LON_EQUATOR * 180, degreesLonToMetersAtLat(-180, 0))); assertEquals(METERS_PER_DEGREE_LON_EQUATOR / 2.0, degreesLonToMetersAtLat(1, 60), DELTA); assertEquals(METERS_PER_DEGREE_LON_EQUATOR / 2.0, degreesLonToMetersAtLat(1, -60), DELTA); }