def test_slope_angle_to_gradient_4(self): slopes = np.array( [0.0, 0.52359878, 0.78539816, 1.04719755, 1.53588974]) grads = np.array([0.0, 0.57735027, 1.0, 1.73205081, 28.63625328]) np.testing.assert_array_almost_equal( grads, slope_angle_to_gradient(slopes, unit="rad"))
def test_slope_angle_to_gradient_2(self): assert slope_angle_to_gradient(0, unit="radian") == 0.0
def test_slope_angle_to_gradient_3(self): np.testing.assert_approx_equal( slope_angle_to_gradient(45.0, unit="deg"), 1.0)
def test_slope_angle_to_gradient_1(self): assert slope_angle_to_gradient(0, unit="degree") == 0.0