Quote:
>Does anyone know how to write a inverse sine (symbol sin-1) function or
>of a .tpu wich contains the like? If so please mail me with the info at
You can use the mathematic serie:
1*x**3 1*3*x**5 1*3*5*x**7
arcsin(x) = x + ----------- + --------------- + ------------------ + .
2*3 2*4*5 2*4*6*7
for abs(x) < 1
where ** stand fo power of
and remembering that arcsin(-x) = -arcsin(x)
or
You can use this code:
Unit Trigo; { en degrs / in degree }
{ de Programmes en Pascal pour Scientifiques et Ingnieurs
par Alan R. Miller, chap. 1
tap par Roger Garipy }
Interface
Function arctg (x, y : real) : real;
Function arcsin (x : real) : real;
Function arccos (x : real) : real;
Implementation
Function arctg (x, y : real) : real;
{ x, y : coordonnes
parce que arctan de Pascal ne spcifie pas le quadrant
de la rponse }
const pi180 = 180.0 / pi;
var a : real;
begin
if x = 0.0
then begin
if y = 0.0
then arctg:=0.0
else arctg:=90.0
end
else if y = 0.0
then arctg:=0.0
else begin
a:=arctan(abs(y/x)) * pi180;
if x > 0.0
then begin
if y > 0.0
then arctg:=a
else arctg:=-a
end
else if y > 0.0
then arctg:=180.0 - a
else arctg:=180.0 + a
end
end { arctg };
Function arcsin (x : real) : real;
begin
if x = 0.0
then arcsin:=0.0
else if x = 1.0
then arcsin:=90.0
else if x = -1.0
then arcsin:=-90.0
else arcsin:=arctg(1.0,x/sqrt(1.0-sqr(x)))
end { arcsin };
Function arccos (x : real) : real;
begin
if x = 0.0
then arccos:=90.0
else if x = 1.0
then arccos:=0.0
else if x = -1.0
then arccos:=180.0
else arccos:=arctg(x/sqrt(1.0-sqr(x)),1.0)
end { arccos };
End.
---
Roger Gariepy Be :-) even if you feel :-(