@@ -263,37 +263,22 @@ impl Coor3D {
263
263
. hypot ( self [ 2 ] - other[ 2 ] )
264
264
}
265
265
266
- /// The 3D distance between two points given as internal angular
267
- /// coordinates. Mostly a shortcut for test authoring
268
- pub fn default_ellps_3d_dist ( & self , other : & Self ) -> f64 {
269
- let e = Ellipsoid :: default ( ) ;
270
- let from = Coor4D ( [ self [ 0 ] , self [ 1 ] , self [ 2 ] , 0. ] ) ;
271
- let to = Coor4D ( [ other[ 0 ] , other[ 1 ] , other[ 2 ] , 0. ] ) ;
272
-
273
- e. cartesian ( & from) . hypot3 ( & e. cartesian ( & to) )
274
- }
275
-
276
- /// The Geodesic distance on the default ellipsoid. Mostly a shortcut
277
- /// for test authoring
278
- pub fn default_ellps_dist ( & self , other : & Self ) -> f64 {
279
- let from = Coor4D ( [ self [ 0 ] , self [ 1 ] , self [ 2 ] , 0. ] ) ;
280
- let to = Coor4D ( [ other[ 0 ] , other[ 1 ] , other[ 2 ] , 0. ] ) ;
281
- Ellipsoid :: default ( ) . distance ( & from, & to)
282
- }
283
266
}
284
267
285
268
// ----- T E S T S ---------------------------------------------------
286
269
287
270
#[ cfg( test) ]
288
271
mod tests {
289
272
use super :: * ;
273
+
290
274
#[ test]
291
275
fn distances ( ) {
276
+ let e = Ellipsoid :: default ( ) ;
292
277
let lat = angular:: dms_to_dd ( 55 , 30 , 36. ) ;
293
278
let lon = angular:: dms_to_dd ( 12 , 45 , 36. ) ;
294
279
let dms = Coor3D :: geo ( lat, lon, 0. ) ;
295
280
let geo = Coor3D :: geo ( 55.51 , 12.76 , 0. ) ;
296
- assert ! ( geo . default_ellps_dist ( & dms) < 1e-10 ) ;
281
+ assert ! ( e . distance ( & geo , & dms) < 1e-10 ) ;
297
282
}
298
283
299
284
#[ test]
0 commit comments