GeoLine extends GeoObject { public double getEasting() { final double easting; if (northEast.getLon() >= southWest.getLon()) { easting = northEast.getLon() - southWest.getLon(); } else { easting = 360.0 + (northEast.getLon() - southWest.getLon()); } assert (0.0 <= easting) && (easting < 360.0) : "Easting not in [0, 360): " + easting + ", " + this; return easting; } GeoLine(
            @Nonnull final GeoPoint southWest,
            @Nonnull final GeoPoint northEast); @SuppressWarnings({"ConstantConditions", "UnusedDeclaration"}) @Deprecated private  GeoLine(); @Nonnull @Override GeoPoint getOrigin(); @Nonnull @Override GeoPoint getCenter(); @Nonnull GeoPoint getSouthWest(); @Nonnull GeoPoint getNorthEast(); @Nonnull GeoLine withSouthWest(@Nonnull final GeoPoint southWest); @Nonnull GeoLine withNorthEast(@Nonnull final GeoPoint northEast); @Nonnull @Override GeoLine translate(@Nonnull final GeoVector vector); @Nonnull @Override GeoLine moveTo(@Nonnull final GeoPoint origin); double getNorthing(); double getEasting(); double getLengthMeters(); boolean isWrappedOnLongSide(); @Nonnull static GeoLine getShortestLine(
            @Nonnull final GeoPoint from,
            @Nonnull final GeoPoint to); double getHeading(); @Override boolean canEqual(@Nonnull final Object obj); @Override boolean equals(@Nullable final Object obj); @Override int hashCode();  }
@Test public void testGetEasting() { LOG.info("testGetEasting"); final GeoPoint x1 = new GeoPoint(0.0, -170.0); final GeoPoint x2 = new GeoPoint(1.0, -20.0); final GeoPoint o = new GeoPoint(2.0, 0.0); final GeoPoint x3 = new GeoPoint(3.0, 20.0); final GeoPoint x4 = new GeoPoint(4.0, 170.0); Assert.assertTrue(MathUtils.isAlmostEqual(150.0, new GeoLine(x1, x2).getEasting())); Assert.assertTrue(MathUtils.isAlmostEqual(360.0 - 150.0, new GeoLine(x2, x1).getEasting())); Assert.assertTrue(MathUtils.isAlmostEqual(170.0, new GeoLine(x1, o).getEasting())); Assert.assertTrue(MathUtils.isAlmostEqual(360.0 - 170.0, new GeoLine(o, x1).getEasting())); Assert.assertTrue(MathUtils.isAlmostEqual(190.0, new GeoLine(x1, x3).getEasting())); Assert.assertTrue(MathUtils.isAlmostEqual(360.0 - 190.0, new GeoLine(x3, x1).getEasting())); Assert.assertTrue(MathUtils.isAlmostEqual(340.0, new GeoLine(x1, x4).getEasting())); Assert.assertTrue(MathUtils.isAlmostEqual(360.0 - 340.0, new GeoLine(x4, x1).getEasting())); }