 |
Арккосинус

function arccos(x:fload):fload;
var
a,result:fload;
begin
textcolor(12);
arccos:=0;
result:=0;
if x=0
then
result:=pi/2
else
if not((x>=-1)and(x<=1))
then
writeln('Неверный "x"!')
else
begin
a:=arctan((sqrt(1-x*x))/x);
if a<0
then
result:=a+pi
else
result:=a;
end;
arccos:=(180/pi)*result;
textcolor(15);
end;
|