aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/110-elliptisch/images/unvollstaendig.m
blob: 25196d072c58b86210d0fa89a49ea7744be8471a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# unvollstaendig.m
#
# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
#
global N;
N = 200;
global n;
n = 5;

function retval = integrand_f(t, k)
	retval = 1 / sqrt((1 - t^2) * (1 - k^2 * t^2));
endfunction

function retval = integrand_e(t, k)
	retval = sqrt((1-k^2*t^2)/(1-t^2));
endfunction

function retval = integrand_pi(n, t, k)
	retval = 1 / ((1-n*t^2) * sqrt((1-k^2*t^2)*(1-t^2)));
endfunction

function retval = elliptisch1(f, name, k)
	global N;
	global n;
	s = 0;
	fprintf(f, "\\def\\ell%s{ (0,0)", name);
	delta = 1 / N;
	for x = (0:delta:(1-delta))
		h = delta / n;
		for t = (x+h/2:h:x+delta)
			s = s + integrand_f(t, k) * h;
		endfor
		fprintf(f, "\n    -- ({\\dx*%.4f},{\\dy*%.4f})", x + delta, s);
	endfor
	fprintf(f, "}\n");
endfunction

function retval = elliptisch2(f, name, k)
	global N;
	global n;
	s = 0;
	fprintf(f, "\\def\\ell%s{ (0,0)", name);
	delta = 1 / N;
	for x = (0:delta:(1-delta))
		h = delta / n;
		for t = (x+h/2:h:x+delta)
			s = s + integrand_e(t, k) * h;
		endfor
		fprintf(f, "\n    -- ({\\dx*%.4f},{\\dy*%.4f})", x + delta, s);
	endfor
	fprintf(f, "\n}\n");
endfunction

fn = fopen("unvollpath.tex", "w");

elliptisch1(fn, "Fzero", 0.0);
elliptisch1(fn, "Fone", 0.1);
elliptisch1(fn, "Ftwo", 0.2);
elliptisch1(fn, "Fthree", 0.3);
elliptisch1(fn, "Ffour", 0.4);
elliptisch1(fn, "Ffive", 0.5);
elliptisch1(fn, "Fsix", 0.6);
elliptisch1(fn, "Fseven", 0.7);
elliptisch1(fn, "Feight", 0.8);
elliptisch1(fn, "Fnine", 0.9);
elliptisch1(fn, "Ften", 1.0);

elliptisch2(fn, "Ezero", 0.0);
elliptisch2(fn, "Eone", 0.1);
elliptisch2(fn, "Etwo", 0.2);
elliptisch2(fn, "Ethree", 0.3);
elliptisch2(fn, "Efour", 0.4);
elliptisch2(fn, "Efive", 0.5);
elliptisch2(fn, "Esix", 0.6);
elliptisch2(fn, "Eseven", 0.7);
elliptisch2(fn, "Eeight", 0.8);
elliptisch2(fn, "Enine", 0.9);
elliptisch2(fn, "Eten", 1.0);

fclose(fn);