|
@ -15,6 +15,13 @@ def rad2deg(radNumber): |
|
|
return (radNumber * 180) / math.pi |
|
|
return (radNumber * 180) / math.pi |
|
|
|
|
|
|
|
|
def sin_approx_bhaskara(radNumber): |
|
|
def sin_approx_bhaskara(radNumber): |
|
|
|
|
|
|
|
|
|
|
|
shallFlipTheResult = 0 |
|
|
|
|
|
if math.pi < radNumber < 2 * math.pi: |
|
|
|
|
|
radNumber -= math.pi |
|
|
|
|
|
shallFlipTheResult = 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
num = multiply(16, radNumber) |
|
|
num = multiply(16, radNumber) |
|
|
num = multiply(num, subract(radNumber, math.pi)) |
|
|
num = multiply(num, subract(radNumber, math.pi)) |
|
|
|
|
|
|
|
@ -23,4 +30,8 @@ def sin_approx_bhaskara(radNumber): |
|
|
denomFrag2 = multiply(denomFrag2, radNumber) |
|
|
denomFrag2 = multiply(denomFrag2, radNumber) |
|
|
denomFrag2 = multiply(denomFrag2, 4) |
|
|
denomFrag2 = multiply(denomFrag2, 4) |
|
|
|
|
|
|
|
|
return divide(num, subract(denomFrag2, denomFrag1)) |
|
|
|
|
|
|
|
|
sinResult = divide(num, subract(denomFrag2, denomFrag1)) |
|
|
|
|
|
|
|
|
|
|
|
if(shallFlipTheResult == 1): |
|
|
|
|
|
return sinResult * -1 |
|
|
|
|
|
return sinResult |