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)