diff --git a/src/main/py/trigonometry.py b/src/main/py/trigonometry.py index 1043118..12107e2 100644 --- a/src/main/py/trigonometry.py +++ b/src/main/py/trigonometry.py @@ -16,9 +16,9 @@ def rad2deg(radNumber): def sin_approx_bhaskara(radNumber): - shallFlipTheResult = 0 + shallFlipTheResult = 0 #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 if math.pi < radNumber < 2 * math.pi: - radNumber -= math.pi + radNumber = subract(math.pi, radNumber) shallFlipTheResult = 1 @@ -33,5 +33,5 @@ def sin_approx_bhaskara(radNumber): sinResult = divide(num, subract(denomFrag2, denomFrag1)) if(shallFlipTheResult == 1): - return sinResult * -1 + return multiply(sinResult, -1) return sinResult \ No newline at end of file