Mein Vorschlag wäre, nur die ganzzahligen Winkel zu vertafeln und Zwischenwerte geradlinig zu interpolieren.
Delphi-Quellcode:
var
CosTable:
array [0..90]
of double;
function CosFromCosTable(Alpha: integer): double;
var
I: integer;
begin
while Alpha < 0
do Inc(Alpha, 360);
while Alpha > 360
do Dec(Alpha, 360);
I:= 1;
if Alpha > 180
then
begin
Dec(Alpha, 180);
I:= -1;
end;
if Alpha <= 90
then
Result:= I * CosTable[Alpha]
else
Result:= - I * CosTable[180 - Alpha];
end;
function SinFromCosTable(Alpha: integer): double;
begin
Result:= CosFromCosTable(90 - Alpha);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
Alpha: integer;
begin
for Alpha:= 0
to 90
do
CosTable[Alpha]:= Cos(Alpha * 0.0174532925199433);
end;