|
|
|
@ -56,24 +56,6 @@ public class GPSCoordinateTest {
|
|
|
|
assertFalse(inside);
|
|
|
|
assertFalse(inside);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* -------
|
|
|
|
|
|
|
|
* | |
|
|
|
|
|
|
|
|
* | |
|
|
|
|
|
|
|
|
* *------
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void edgeSquareTest() {
|
|
|
|
|
|
|
|
boundary.add(new GPSCoordinate(0, 0));
|
|
|
|
|
|
|
|
boundary.add(new GPSCoordinate(10, 0));
|
|
|
|
|
|
|
|
boundary.add(new GPSCoordinate(10, 10));
|
|
|
|
|
|
|
|
boundary.add(new GPSCoordinate(0, 10));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GPSCoordinate coordinate = new GPSCoordinate(0, 0);
|
|
|
|
|
|
|
|
boolean inside = GPSCoordinate.isInsideBoundary(coordinate, boundary);
|
|
|
|
|
|
|
|
assertFalse(inside);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void insideShapeWithObtuseAnglesTest() {
|
|
|
|
public void insideShapeWithObtuseAnglesTest() {
|
|
|
|
boundary.add(new GPSCoordinate(0, 0));
|
|
|
|
boundary.add(new GPSCoordinate(0, 0));
|
|
|
|
@ -104,18 +86,21 @@ public class GPSCoordinateTest {
|
|
|
|
assertFalse(inside);
|
|
|
|
assertFalse(inside);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* -------
|
|
|
|
|
|
|
|
* | |
|
|
|
|
|
|
|
|
* * | |
|
|
|
|
|
|
|
|
* -------
|
|
|
|
|
|
|
|
*/
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void edgeOfShapeWithObtuseAnglesTest() {
|
|
|
|
public void earlyTerminationTest() {
|
|
|
|
boundary.add(new GPSCoordinate(0, 0));
|
|
|
|
boundary.add(new GPSCoordinate(0, 0));
|
|
|
|
boundary.add(new GPSCoordinate(4, 4));
|
|
|
|
boundary.add(new GPSCoordinate(10, 0));
|
|
|
|
boundary.add(new GPSCoordinate(7, 2));
|
|
|
|
|
|
|
|
boundary.add(new GPSCoordinate(9, 5));
|
|
|
|
|
|
|
|
boundary.add(new GPSCoordinate(10, 10));
|
|
|
|
boundary.add(new GPSCoordinate(10, 10));
|
|
|
|
boundary.add(new GPSCoordinate(6, 6));
|
|
|
|
boundary.add(new GPSCoordinate(0, 10));
|
|
|
|
boundary.add(new GPSCoordinate(2, 10));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GPSCoordinate coordinate = new GPSCoordinate(2, 10);
|
|
|
|
GPSCoordinate coordinate = new GPSCoordinate(-2, 8);
|
|
|
|
boolean inside = GPSCoordinate.isInsideBoundary(coordinate, boundary);
|
|
|
|
boolean inside = GPSCoordinate.isInsideBoundary(coordinate, boundary, new GPSCoordinate(0, 0), new GPSCoordinate(10, 10));
|
|
|
|
assertFalse(inside);
|
|
|
|
assertFalse(inside);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|