Changeset 13712 in josm for trunk/test


Ignore:
Timestamp:
2018-05-07T23:40:50+02:00 (15 months ago)
Author:
Don-vip
Message:

see #16256 - improve "building with almost square angle" autofix: try to move only the highlighted node

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java

    r13670 r13712  
    55
    66import java.io.FileInputStream;
     7import java.util.Arrays;
    78import java.util.List;
    89
     
    145146        assertEquals(162.66381817961337, angle, 1e-5);
    146147    }
     148
     149    /**
     150     * Test of {@link Geometry#getCentroidEN} method.
     151     */
     152    @Test
     153    public void testCentroidEN() {
     154        EastNorth en1 = new EastNorth(100, 200);
     155        EastNorth en2 = new EastNorth(150, 400);
     156        EastNorth en3 = new EastNorth(200, 200);
     157        assertEquals(en1, Geometry.getCentroidEN(Arrays.asList(en1)));
     158        assertEquals(new EastNorth(125, 300), Geometry.getCentroidEN(Arrays.asList(en1, en2)));
     159        assertEquals(new EastNorth(150, 266d + 2d/3d), Geometry.getCentroidEN(Arrays.asList(en1, en2, en3)));
     160    }
    147161}
Note: See TracChangeset for help on using the changeset viewer.