aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/110-elliptisch/agm/agm.m
blob: dcb3ad88f4ee7967f95539e67031a2e8fb1d8ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#
# agm.m
#
# (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
#
format long

n = 10;
a = 1;
b = sqrt(0.5);

for i = (1:n)
	printf("%20.16f %20.16f\n", a, b);
	A = (a+b)/2;
	b = sqrt(a*b);
	a = A;
end	

K = pi / (2 * a)