    @Test
    public void testGetDistanceToPathKm4() {

        // positions to test
        Position p = new Position(-10, 150);

        // segment positions constituting a path
        Position sp1 = new Position(-30, 100);
        Position sp2 = new Position(-20, 120);
        Position sp3 = new Position(-30, 140);

        // path with two segments
        List<Position> path = new ArrayList<Position>();
        path.add(sp1);
        path.add(sp2);
        path.add(sp3);

        // expect that the closes point will be sp2 itself since the test
        // position can't be perpendicular to the segment and sp2 is the closest
        // point.

        double r = p.getDistanceToPathKm(path);
        log.info(r + "");
        // 2452 according http://www.nhc.noaa.gov/gccalc.shtml
        assertEquals(2452, r, ACCEPTABLE_DISTANCE_PRECISION);
    }