diff options
author | LordMcFungus <mceagle117@gmail.com> | 2022-07-22 21:28:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-22 21:28:45 +0200 |
commit | 23f17598c1742c70f442b94044a20aa821022c5a (patch) | |
tree | a945540ee6a4e86b37df2f01e3a91584b4797c4f /vorlesungen/slides/fresnel/eulerspirale.m | |
parent | Merge pull request #2 from AndreasFMueller/master (diff) | |
parent | Merge pull request #25 from JODBaer/master (diff) | |
download | SeminarSpezielleFunktionen-23f17598c1742c70f442b94044a20aa821022c5a.tar.gz SeminarSpezielleFunktionen-23f17598c1742c70f442b94044a20aa821022c5a.zip |
Merge pull request #3 from AndreasFMueller/master
update
Diffstat (limited to '')
-rw-r--r-- | vorlesungen/slides/fresnel/eulerspirale.m | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/vorlesungen/slides/fresnel/eulerspirale.m b/vorlesungen/slides/fresnel/eulerspirale.m new file mode 100644 index 0000000..84e3696 --- /dev/null +++ b/vorlesungen/slides/fresnel/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); |