def testHalfAngleEquatorAndTwoPoles(self): self.assertAlmostEqual( geo.sphere_angle(lat1=-90.0, lon1=0.0, lat=0.0, lon=0.0, lat2=90.0, lon2=0.0), 180.0)
def testHalfAngleOnTheEquator(self): self.assertAlmostEqual( geo.sphere_angle(lat1=0.0, lon1=5.0, lat=0.0, lon=0.0, lat2=0.0, lon2=-5.0), 180.0)
def testBrusselsLondonParis(self): self.assertAlmostEqual(geo.sphere_angle(lat1=50.85, lon1=4.35, lat=51.507222, lon=-0.1275, lat2=48.856667, lon2=2.350833), 46.704, places=3)
def testFlatAngleOnTheEquator(self): self.assertAlmostEqual(geo.sphere_angle(lat1=0.0, lon1=-20.0, lat=0.0, lon=0.0, lat2=0.0, lon2=-40.0), 0.0, places=5)
def testEquatorAndStraightNorthSouth(self): for latitude in [10.0, -20.0, 30.0, -50.0, 90.0]: self.assertAlmostEqual( geo.sphere_angle(lat1=0.0, lon1=-20.0, lat=0.0, lon=0.0, lat2=latitude, lon2=0.0), 90.0)