From a866d7cd6672474e9376617aadc91424b9ba3506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sun, 8 May 2022 22:37:45 +0200 Subject: add Fresnel presentation --- vorlesungen/slides/fresnel/eulerspirale.m | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 vorlesungen/slides/fresnel/eulerspirale.m (limited to 'vorlesungen/slides/fresnel/eulerspirale.m') diff --git a/vorlesungen/slides/fresnel/eulerspirale.m b/vorlesungen/slides/fresnel/eulerspirale.m new file mode 100644 index 0000000..312541a --- /dev/null +++ b/vorlesungen/slides/fresnel/eulerspirale.m @@ -0,0 +1,34 @@ +# +# eulerspirale.m +# +# (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschlue +# +global n; +n = 10000; +global tmax; +tmax = 10; + +function retval = f(x, t) + retval = [ cos(t*t); sin(t*t) ]; +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"); + +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"); + +fclose(fn); -- cgit v1.2.1