aboutsummaryrefslogtreecommitdiffstats
path: root/buch/papers/fresnel/images/eulerspirale.m
diff options
context:
space:
mode:
authorRunterer <37069007+Runterer@users.noreply.github.com>2022-05-26 15:44:34 +0200
committerGitHub <noreply@github.com>2022-05-26 15:44:34 +0200
commit97f9df441a8cf9e86545a7db2e0c1e935937638f (patch)
tree43adb2438e1e316c34997b13bb2d0fa3044f8f1b /buch/papers/fresnel/images/eulerspirale.m
parentadded tikz -> kudos nic (diff)
parentMerge branch 'master' of github.com:AndreasFMueller/SeminarSpezielleFunktionen (diff)
downloadSeminarSpezielleFunktionen-97f9df441a8cf9e86545a7db2e0c1e935937638f.tar.gz
SeminarSpezielleFunktionen-97f9df441a8cf9e86545a7db2e0c1e935937638f.zip
Merge branch 'AndreasFMueller:master' into master
Diffstat (limited to 'buch/papers/fresnel/images/eulerspirale.m')
-rw-r--r--buch/papers/fresnel/images/eulerspirale.m61
1 files changed, 61 insertions, 0 deletions
diff --git a/buch/papers/fresnel/images/eulerspirale.m b/buch/papers/fresnel/images/eulerspirale.m
new file mode 100644
index 0000000..84e3696
--- /dev/null
+++ b/buch/papers/fresnel/images/eulerspirale.m
@@ -0,0 +1,61 @@
+#
+# eulerspirale.m
+#
+# (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschlue
+#
+global n;
+n = 1000;
+global tmax;
+tmax = 10;
+global N;
+N = round(n*5/tmax);
+
+function retval = f(x, t)
+ x = pi * t^2 / 2;
+ retval = [ cos(x); sin(x) ];
+endfunction
+
+x0 = [ 0; 0 ];
+t = tmax * (0:n) / n;
+
+c = lsode(@f, x0, t);
+
+fn = fopen("eulerpath.tex", "w");
+
+fprintf(fn, "\\def\\fresnela{ (0,0)");
+for i = (2:n)
+ fprintf(fn, "\n\t-- (%.4f,%.4f)", c(i,1), c(i,2));
+end
+fprintf(fn, "\n}\n\n");
+
+fprintf(fn, "\\def\\fresnelb{ (0,0)");
+for i = (2:n)
+ fprintf(fn, "\n\t-- (%.4f,%.4f)", -c(i,1), -c(i,2));
+end
+fprintf(fn, "\n}\n\n");
+
+fprintf(fn, "\\def\\Cplotright{ (0,0)");
+for i = (2:N)
+ fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})", t(i), c(i,1));
+end
+fprintf(fn, "\n}\n\n");
+
+fprintf(fn, "\\def\\Cplotleft{ (0,0)");
+for i = (2:N)
+ fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})", -t(i), -c(i,1));
+end
+fprintf(fn, "\n}\n\n");
+
+fprintf(fn, "\\def\\Splotright{ (0,0)");
+for i = (2:N)
+ fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})", t(i), c(i,2));
+end
+fprintf(fn, "\n}\n\n");
+
+fprintf(fn, "\\def\\Splotleft{ (0,0)");
+for i = (2:N)
+ fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})", -t(i), -c(i,2));
+end
+fprintf(fn, "\n}\n\n");
+
+fclose(fn);