def test_delta_in_meters_increasing_lat(self): initial_point = LatLon(10, 65) final_point = LatLon(11, 65) expected_delta = (110605.5709, 0.0000000002) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[0], expected_delta[0], places=4) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[1], expected_delta[1], places=4)
def test_delta_in_meters_decreasing_lon(self): initial_point = LatLon(10, 65) final_point = LatLon(10, 64) expected_delta = (166.1395712, -109633.7978) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[0], expected_delta[0], places=4) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[1], expected_delta[1], places=4)
def test_delta_in_meters_decreasing_lat(self): initial_point = LatLon(10, 65) final_point = LatLon(9, 65) expected_delta = (-110598.9407, 0.0000000002) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[0], expected_delta[0], places=4) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[1], expected_delta[1], places=4)
def test_delta_in_meters_with_no_displacement(self): initial_point = LatLon(10, 65) final_point = LatLon(10, 65) expected_delta = (0, 0) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[0], expected_delta[0], places=4) self.assertAlmostEqual(initial_point.delta_in_meters(final_point)[1], expected_delta[1], places=4)