Changeset 9806 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-02-15T18:41:57+01:00 (9 years ago)
Author:
bastiK
Message:

see #12524 - forgot to commit tests (patch by kolesar)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java

    r8857 r9806  
    1010 */
    1111public class LatLonTest {
     12
     13    private static final double EPSILON = 1e-6;
    1214
    1315    public static final double[] SAMPLE_VALUES = new double[]{
     
    124126        }
    125127    }
     128
     129    /**
     130     * Test of {@link LatLon#bearing}
     131     */
     132    @Test
     133    public void testBearing() {
     134        LatLon c = new LatLon(47.000000, 19.000000);
     135        LatLon e = new LatLon(47.000000, 19.000001);
     136        LatLon n = new LatLon(47.000001, 19.000000);
     137        assertEquals(  0, Math.toDegrees(c.bearing(n)), EPSILON);
     138        assertEquals( 90, Math.toDegrees(c.bearing(e)), EPSILON);
     139        assertEquals(180, Math.toDegrees(n.bearing(c)), EPSILON);
     140        assertEquals(270, Math.toDegrees(e.bearing(c)), EPSILON);
     141    }
    126142}
Note: See TracChangeset for help on using the changeset viewer.