2424import static org .junit .Assert .assertEquals ;
2525
2626public class PointTest {
27- private static final Logger LOG = LoggerFactory .getLogger (PointTest .class );
27+ private static final Logger LOG = LoggerFactory .getLogger (PointTest .class );
2828 private static final double DELTA = 0.000001 ;
2929
3030 @ Test
@@ -75,17 +75,17 @@ public void testDegreesLonToMeters() {
7575
7676 assertEquals (0 , Double .compare (0 , Point .degreesLonToMetersAtLat (0 , 0 )));
7777 assertEquals (0 ,
78- Double .compare (Point .METERS_PER_DEGREE_LON_EQUATOR / 2.0 , Point .degreesLonToMetersAtLat (0.5 , 0 )));
78+ Double .compare (Point .METERS_PER_DEGREE_LON_EQUATOR / 2.0 , Point .degreesLonToMetersAtLat (0.5 , 0 )));
7979 assertEquals (0 ,
80- Double .compare (Point .METERS_PER_DEGREE_LON_EQUATOR , Point .degreesLonToMetersAtLat (1 , 0 )));
80+ Double .compare (Point .METERS_PER_DEGREE_LON_EQUATOR , Point .degreesLonToMetersAtLat (1 , 0 )));
8181 assertEquals (0 ,
82- Double .compare (Point .METERS_PER_DEGREE_LON_EQUATOR * 180 , Point .degreesLonToMetersAtLat (180 , 0 )));
82+ Double .compare (Point .METERS_PER_DEGREE_LON_EQUATOR * 180 , Point .degreesLonToMetersAtLat (180 , 0 )));
8383 assertEquals (0 ,
84- Double .compare (-Point .METERS_PER_DEGREE_LON_EQUATOR * 180 , Point .degreesLonToMetersAtLat (-180 , 0 )));
84+ Double .compare (-Point .METERS_PER_DEGREE_LON_EQUATOR * 180 , Point .degreesLonToMetersAtLat (-180 , 0 )));
8585 Assert .assertTrue (Math .abs ((Point .METERS_PER_DEGREE_LON_EQUATOR / 2.0 ) -
86- Point .degreesLonToMetersAtLat (1 , 60 )) < DELTA );
86+ Point .degreesLonToMetersAtLat (1 , 60 )) < DELTA );
8787 Assert .assertTrue (Math .abs ((Point .METERS_PER_DEGREE_LON_EQUATOR / 2.0 ) -
88- Point .degreesLonToMetersAtLat (1 , -60 )) < DELTA );
88+ Point .degreesLonToMetersAtLat (1 , -60 )) < DELTA );
8989 }
9090
9191 @ Test
@@ -94,44 +94,44 @@ public void testMetersToDegreesLon() {
9494
9595 assertEquals (0 , Double .compare (0 , Point .metersToDegreesLonAtLat (0 , 0 )));
9696 assertEquals (0 ,
97- Double .compare (0.5 , Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR / 2 , 0 )));
97+ Double .compare (0.5 , Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR / 2 , 0 )));
9898 assertEquals (0 ,
99- Double .compare (1 , Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR , 0 )));
99+ Double .compare (1 , Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR , 0 )));
100100 assertEquals (0 ,
101- Double .compare (180 , Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR * 180 , 0 )));
101+ Double .compare (180 , Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR * 180 , 0 )));
102102 assertEquals (0 , Double .compare (-180 ,
103- Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR * -180 , 0 )));
103+ Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR * -180 , 0 )));
104104 Assert .assertTrue (
105- Math .abs (2.0 - Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR , 60 )) < DELTA );
105+ Math .abs (2.0 - Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR , 60 )) < DELTA );
106106 Assert .assertTrue (
107- Math .abs (2.0 - Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR , -60 )) < DELTA );
107+ Math .abs (2.0 - Point .metersToDegreesLonAtLat (Point .METERS_PER_DEGREE_LON_EQUATOR , -60 )) < DELTA );
108108 }
109109
110110 @ Test
111111 public void testDistanceInMeters () {
112112 LOG .info ("testDistanceInMeters" );
113113
114114 double d = Point .METERS_PER_DEGREE_LAT - Point .distanceInMeters (Point .fromMicroDeg (-500000 , 0 ),
115- Point .fromMicroDeg (500000 , 0 ));
115+ Point .fromMicroDeg (500000 , 0 ));
116116 Assert .assertTrue (Math .abs (d ) <= DELTA );
117117
118118 d = Point .METERS_PER_DEGREE_LAT - Point .distanceInMeters (Point .fromMicroDeg (80000000 , 0 ),
119- Point .fromMicroDeg (81000000 , 0 ));
119+ Point .fromMicroDeg (81000000 , 0 ));
120120 Assert .assertTrue (Math .abs (d ) <= DELTA );
121121
122122 d = (Point .METERS_PER_DEGREE_LAT * 2 ) - Point .distanceInMeters (Point .fromMicroDeg (59000000 , 0 ),
123- Point .fromMicroDeg (61000000 , 0 ));
123+ Point .fromMicroDeg (61000000 , 0 ));
124124 Assert .assertTrue (Math .abs (d ) <= DELTA );
125125
126126 Assert .assertTrue (Math .abs (Point .METERS_PER_DEGREE_LON_EQUATOR - Point .distanceInMeters (
127- Point .fromMicroDeg (0 , -500000 ), Point .fromMicroDeg (0 , 500000 ))) <= DELTA );
127+ Point .fromMicroDeg (0 , -500000 ), Point .fromMicroDeg (0 , 500000 ))) <= DELTA );
128128 Assert .assertTrue (Math .abs (Point .METERS_PER_DEGREE_LON_EQUATOR - Point .distanceInMeters (
129- Point .fromMicroDeg (0 , 80000000 ), Point .fromMicroDeg (0 , 81000000 ))) < DELTA );
129+ Point .fromMicroDeg (0 , 80000000 ), Point .fromMicroDeg (0 , 81000000 ))) < DELTA );
130130 Assert .assertTrue (Math .abs ((Point .METERS_PER_DEGREE_LON_EQUATOR / 2.0 ) - Point .distanceInMeters (
131- Point .fromMicroDeg (60000000 , 80000000 ), Point .fromMicroDeg (60000000 , 81000000 ))) <= DELTA );
131+ Point .fromMicroDeg (60000000 , 80000000 ), Point .fromMicroDeg (60000000 , 81000000 ))) <= DELTA );
132132
133133 Assert .assertTrue (Math .abs ((Point .METERS_PER_DEGREE_LON_EQUATOR * 2 ) - Point .distanceInMeters (
134- Point .fromMicroDeg (0 , -1000000 ), Point .fromMicroDeg (0 , 1000000 ))) <= DELTA );
134+ Point .fromMicroDeg (0 , -1000000 ), Point .fromMicroDeg (0 , 1000000 ))) <= DELTA );
135135
136136 Assert .assertTrue (Point .distanceInMeters (Point .fromDeg (0.0 , 180.0 ), Point .fromDeg (0.0 , -179.999977 )) < 10.0 );
137137 Assert .assertTrue (Point .distanceInMeters (Point .fromDeg (0.0 , -179.999977 ), Point .fromDeg (0.0 , 180.0 )) < 10.0 );
0 commit comments