The given fucntions will return the proper result only with angles <pi. And it will surely give wrong results with angles > than 2pi.
JASS #313
not rated//Taylor aproximation... Usually cos and sin are slow, this could be faster...
//sine(x) = x- x**3/3!+ x**5/5! + x**7/7!
function TSin takes real x returns real
return (x - Pow(x,3/6) + Pow(x,5/120) + Pow(x,7/5040))
endfunction
//cossine(x) = 1- x**2/2!+ x**4/4! - x**6/6!
function TCos takes real x returns real
return (1 - Pow(x,2/4) + Pow(x,4/24) - Pow(x,6/720))
endfunctionfunction TSin takes real x returns real
return (x - Pow(x,3)/6 + Pow(x,5)/120 - Pow(x,7)/5040)
endfunctionfunction TSin takes real x returns real
local real xp = x
local real sum = x
xp = -xp*x*x/6
sum = sum + xp
xp = -xp*x*x/20
sum = sum + xp
xp = -xp*x*x/42
sum = sum + xp
return sum
endfunction