You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
453 B

function fsin(s)
local x=s
if x>180.0 then
x=(x+180)%360-180
elseif x<-180.0 then
x=(x-180)%-360+180
end
if x>90.0 then
x=180.0-x
elseif x<-90.0 then
x=-180-x
end
-- print (x)
x=math.pi*x/180.0
local p=x
local f=1
local r=p
-- print (x)
-- 6 Stellen hinter dem Komma fuer 1/4-Kreis
for j=2,10,2 do
p=-p * x * x
f=f*j*(j+1)
r=r+p/f
end
return(r)
end
function fcos(c)
return fsin(90-c)
end