aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/110-elliptisch/agm.m
diff options
context:
space:
mode:
authorAndreas Müller <andreas.mueller@ost.ch>2022-06-25 14:36:04 +0200
committerAndreas Müller <andreas.mueller@ost.ch>2022-06-25 14:36:04 +0200
commit7cc8f34f003ecb25ade7f1ff2287fe12b5a22c40 (patch)
tree4a234cf09ee14df548f9937fd1f08baa5e564900 /buch/chapters/110-elliptisch/agm.m
parentmore improvements (diff)
downloadSeminarSpezielleFunktionen-7cc8f34f003ecb25ade7f1ff2287fe12b5a22c40.tar.gz
SeminarSpezielleFunktionen-7cc8f34f003ecb25ade7f1ff2287fe12b5a22c40.zip
arithmetic-geometric-mean
Diffstat (limited to 'buch/chapters/110-elliptisch/agm.m')
-rw-r--r--buch/chapters/110-elliptisch/agm.m20
1 files changed, 20 insertions, 0 deletions
diff --git a/buch/chapters/110-elliptisch/agm.m b/buch/chapters/110-elliptisch/agm.m
new file mode 100644
index 0000000..2f0a1ea
--- /dev/null
+++ b/buch/chapters/110-elliptisch/agm.m
@@ -0,0 +1,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
+
+E = 2 / (pi * a)
+