Léonie,
This is what I am using for sine and cosine. Don't know if you need the rest or can work off these. These seem to work but I'm no mathematician so I can give no guarantee.
regards
-- Trig functions from http://lists.apple.com/archives/applescript-users/2004/Feb/msg00939.html
-- "A simple Taylor series expansion needs a whole lot more iterations for angles for
-- which the answer is nearly unity. Chebycheff polynomials are a whole lot better."
----------------------------
on cosine(x) -- degrees
local myCos, numerator, denominator, factor
set myCos to 0
if (x = 90) or (x = 270) then
set myCos to 0
else
set x to (x - (((x / 360) div 1) * 360)) * (pi / 180)
set {myCos, numerator, denominator, factor} to {0, 1, 1, -(x ^ 2)}
repeat with i from 2 to 40 by 2
set myCos to myCos + numerator / denominator
set numerator to numerator * factor
set denominator to denominator * i * (i - 1)
end repeat
end if
return myCos
end cosine
----------------------------
on sine(x) -- degrees
local mySin, numerator, denomintator, factor
set mySin to 0
if (x = 180) or (x = 360) then
set mySin to 0
else
set x to (x - (((x / 360) div 1) * 360)) * (pi / 180)
set {mySin, numerator, denominator, factor} to {0, x, 1, -(x ^ 2)}
repeat with i from 3 to 40 by 2
set mySin to mySin + numerator / denominator
set numerator to numerator * factor
set denominator to denominator * i * (i - 1)
end repeat
end if
return mySin
end sine