Beispiel #1
0
    def test_change_in_longitude(self):
        latitude = 70
        km = 200
        expected = 5.254622441495266

        # Test positive latitude, positive km
        output = geodetics.change_in_longitude(latitude, km)
        self.assertAlmostEqual(output, expected)

        # Test negative latitude, positive km
        output = geodetics.change_in_longitude(-latitude, km)
        self.assertAlmostEqual(output, expected)

        # Test positive latitude, negative km
        output = geodetics.change_in_longitude(latitude, -km)
        self.assertAlmostEqual(output, -expected)

        # Test negative latitude, negative km
        output = geodetics.change_in_longitude(-latitude, -km)
        self.assertAlmostEqual(output, -expected)
    def test_change_in_longitude(self):
        latitude = 70
        km = 200
        expected = 5.254622441495266

        # Test positive latitude, positive km
        output = geodetics.change_in_longitude(latitude, km)
        self.assertAlmostEqual(output, expected)

        # Test negative latitude, positive km
        output = geodetics.change_in_longitude(-latitude, km)
        self.assertAlmostEqual(output, expected)

        # Test positive latitude, negative km
        output = geodetics.change_in_longitude(latitude, -km)
        self.assertAlmostEqual(output, -expected)

        # Test negative latitude, negative km
        output = geodetics.change_in_longitude(-latitude, -km)
        self.assertAlmostEqual(output, -expected)
Beispiel #3
0
 def test_change_in_longitude_zero_km(self):
     self.assertEqual(geodetics.change_in_longitude(70, 0), 0)
 def test_change_in_longitude_zero_km(self):
     self.assertEqual(geodetics.change_in_longitude(70, 0), 0)