Alternate Distance Succession ============================= Let's consider the recursive definition of a mathematical succession parameterized by the real number constants :math:`a`, :math:`b`, and :math:`k`: :math:`x_{1} = a` :math:`x_{2} = b` :math:`x_{i+1} = (-1)^{i+1} \frac{1+\sqrt{ {x_i}² + {x_{i-1}}² } }{2} \pi` Implement the following two Python functions (following the order is recommended) in the module :mod:`adist_succ` (file :file:`adist_succ.py`). The first function is: .. py:function:: adist_term(xim1, xi, i) such that **given** ``xim1``, ``xi`` :class:`float` values, where ``xim1``, ``xi``, are the values for two consecutive terms of our succession, and ``i`` is an :class:`int` index of ``xi`` **returns** a :class:`float` with the term ``i+1`` of the succession above For exemple: .. literalinclude:: adist_term.test :language: python3 :start-after: --ini :end-before: --fi .. note:: Python standard modules such as :mod:`math` **may** be imported and used. Doctests are available at the :download:`adist_term.test` file. ----------------------------------------------------------------------------------- The second function is: .. py:function:: adist_t4t5(a, b) such that **given** ``a``, ``b``, :class:`float` values being the 1st and 2nd terms of the succession respectively **returns** a :class:`float` with the addition of the 4th and the 5th terms of the succession above. The float is rounded to 4 decimals. For exemple: .. literalinclude:: adist_t4t5.test :language: python3 :start-after: --ini :end-before: --fi .. note:: This function implementation **must** call the previous function as many times as needed. Doctests for validation are available at the :download:`adist_t4t5.test` file.