Пример #1
0
def test_dms2deg():
    assert_almost_equal(util.dms2deg([12, 30, 0]), 12 + 30 / 60.)
    assert_almost_equal(util.dms2deg([12, 30, 30]), 12 + 30 / 60. + 30 / 3600.)
    assert_almost_equal(util.dms2deg([-12, -30, -30]),
                        -12 - 30 / 60. - 30 / 3600.)
    assert_almost_equal(util.deg2dms(util.dms2deg([12, 1, 2])), [12, 1, 2])
Пример #2
0
def test_deg2dms():
    assert_almost_equal(util.deg2dms(12 + 30 / 60.), [12, 30, 0])
    assert_almost_equal(util.deg2dms(12 + 30 / 60. + 30 / 3600.), [12, 30, 30])
    assert_almost_equal(util.deg2dms(-12 - 30 / 60. - 30 / 3600.),
                        [-12, -30, -30])
    assert_almost_equal(util.dms2deg(util.deg2dms(12.123)), 12.123)