Unit circle/Circle length/Bisection/Program/Exercise

From Wikiversity
Jump to navigation Jump to search

We consider the unit circle, i.e.

We put and , and we define recursively the sequence (in the plane) by

(that is, is the bisection point of the line segment between and ), and is the intersection point of the half-line through and and the circle. We consider the lengths as an approximation for the length of the circle arc between and , and therefore

is an approximation for the length of the half circle arc (that is, ). Since in the computation of the points and the lengths , square roots occure (due to the Pythagorean theorem), we can approximate these by rational numbers only with certain errors.

Write a computer-program (in pseudocode), which computes and prints a sequence of approximations () for . In the computation of , all square roots, which are used in the computation of , shall be computed with steps of Heron's method, starting with the initial value . Also, the program shall use better and better approximations for the auxiliary points, the computation of requires that better and better approximations for are determined.

    • The computer has as many memory units as needed, which can contain rational numbers.
    • The natural numbers are provided in a data base (they do not have to be computed).
    • It can write the content of a memory unit into another memory unit.
    • It can do the arithmetic operations (addition, subtraction, multiplication, division by a number ) on rational numbers and write the result in another memory unit.
    • It can compare the content of memory units and can, depending on the outcome, switch to a certain program line.
    • It can print contents of memory units and it can print given texts.
The program shall run to infinity and write down the approximations .