Esempio n. 1
0
 def testEquatorToSouthPole(self):
     for lon in [0.0, 15.0, 45.0, 90.0, 180.0, 270.0]:
         self.assertAlmostEqual(
             geo.bearing_to(
                 lat1=0.0, lon1=lon,
                 lat2=-90.0, lon2=lon),
             180.0)
Esempio n. 2
0
 def bearing_to(self, other):
     """Computes bearing in degrees to another GNSSFix."""
     return geo.bearing_to(self.lat, self.lon, other.lat, other.lon)
Esempio n. 3
0
 def testHonoluluToKualaLumpur(self):
     self.assertAlmostEqual(
         geo.bearing_to(
             lat1=21.3, lon1=-157.816667,
             lat2=3.133333, lon2=101.683333),
         -83.20267, places=4)
Esempio n. 4
0
 def testLondonToNewYork(self):
     self.assertAlmostEqual(
         geo.bearing_to(
             lat1=51.507222, lon1=-0.1275,
             lat2=40.7127, lon2=-74.0059),
         -71.67013, places=4)
Esempio n. 5
0
 def testEquatorFacingWest(self):
     self.assertAlmostEqual(
         geo.bearing_to(
             lat1=0.0, lon1=0.0,
             lat2=0.0, lon2=-15.0),
         -90.0)
Esempio n. 6
0
 def bearing_to(self, other):
     """Computes bearing in degrees to another GNSSFix."""
     return geo.bearing_to(self.lat, self.lon, other.lat, other.lon)