Функция вычисления ArcSin
Категория: Delphi/Pascal
2012-02-02 22:04:09
code: #pascal
Function arcsinala(X : real):real; Const E = 2.9e-19; Var Temp : real; arcsin : real; N : Word; Function Pow(A,B:real):real; Var T:Real; Begin T := Abs(A); Pow := Exp(B*Ln(T)); End; Function ElemMakloren(A:integer):Real; Var I : integer; Result : Real; Begin If A > 1 Then Begin Result := 1; For I := 1 To A-1 Do Begin If I mod 2 = 0 Then Result := Result / I Else Result := Result * I; End; If A mod 2 = 0 Then Result := 0; If A >= 3 Then Result := Result * Pow(X,A) / A; End Else Result := A * X; ElemMakloren := Result; End; Begin arcsin := 0; N := 1; Temp := 1; While Temp >= E Do Begin Temp := ElemMakloren(N); arcsin := arcsin + Temp; N := N + 2; End; arcsinala:=arcsin; End; {--------------------} begin writeln(arcsinala(0.9):4:9); end.
Поделиться: