@ -14,6 +14,9 @@ def pi_approx_leibniz(precision):
def rad2deg(radNumber):
return (radNumber * 180) / math.pi
def deg2rad(degNumber):
return degNumber
def sin_approx_bhaskara(radNumber):
shallFlipTheResult = False #the bhaskara function can only be used between zero and pi. For the rest of the sin period I simply mirrored the first arch of the curve to match the actual sine wave
@ -37,6 +37,9 @@ class MyTestCase(unittest.TestCase):
delta *= -1
self.assertLess(delta, 0.01)
def test_0_deg_to_rad_should_be_0(self):
self.assertEqual(deg2rad(0), 0)
def test_sin_0_should_be_0(self):
self.assertEqual(sin_approx_bhaskara(0), 0)