summaryrefslogtreecommitdiff
path: root/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Fouriercoeff.sci
diff options
context:
space:
mode:
Diffstat (limited to 'texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Fouriercoeff.sci')
-rwxr-xr-xtexmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Fouriercoeff.sci21
1 files changed, 21 insertions, 0 deletions
diff --git a/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Fouriercoeff.sci b/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Fouriercoeff.sci
new file mode 100755
index 00000000..af259244
--- /dev/null
+++ b/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/Fouriercoeff.sci
@@ -0,0 +1,21 @@
+// 09.03.13
+
+function Out=Fouriercoeff(Fn,T,Ch,K)
+ Eps=10^(-5);
+ L=T/2;
+ Tmp1='Out=FUNC(x)';
+ if Ch=='c'
+ Tmp2='Out=Fn(10*L*x)*cos('+string(K)+'*%pi*x*10)';
+ else
+ Tmp2='Out=Fn(10*L*x)*sin('+string(K)+'*%pi*x*10)';
+ end;
+ deff(Tmp1,Tmp2);
+ Out=10*intg(-0.1,0.1,FUNC);
+ if K==0
+ Out=Out/2;
+ end;
+ if abs(Out)<Eps
+ Out=0;
+ end;
+endfunction;
+