Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // EXE: http://machalda.cekuj.net/d.php?f=33
- program SinVSfSin;
- var volba:real;
- function fSin(uhel:real):real;
- const eps = 0.00001;
- var vysledek:real;
- pom:real;
- index:integer;
- begin
- index:=0;
- vysledek:=uhel;
- pom:=uhel;
- while abs(pom) < eps do
- begin
- index:=index+1;
- pom := -pom * sqr(uhel) / (2*index*(2*index+1));
- vysledek:=vysledek+pom;
- end;
- fSin:=vysledek;
- end;
- begin
- writeln('#############################################################');
- writeln('#');
- writeln('# Zadej uhel');
- write('#-> uhel: ');
- readln(volba);
- writeln('#');
- writeln('# Standartni funkce SIN() : ',sin(volba));
- writeln('# Aproximovana fce fSin() : ',fSin(volba));
- volba:=abs(sin(volba) - fSin(volba));
- writeln('# Odchylka SIN()-fSin() : ', volba);
- writeln('#');
- writeln('######################## KONEC ##############################');
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement