






'''simple docstring'''

from math import isclose, sqrt







def 					lowercase__				(   __UpperCamelCase	,		__UpperCamelCase	,		__UpperCamelCase					)->				tuple[float, float, float]:
      UpperCamelCase       						=      point_y / 4 / point_x
      UpperCamelCase       						=      2 * normal_gradient / (1 + normal_gradient * normal_gradient)
      UpperCamelCase       						=      (1 - normal_gradient * normal_gradient) / (
          1 + normal_gradient * normal_gradient
      )
      UpperCamelCase       						=      (sa - ca * incoming_gradient) / (ca + sa * incoming_gradient)

      # to find the next point, solve the simultaeneous equations:
      # y^2 + 4x^2 = 100
      # y - b = m * (x - a)
      # ==> A x^2 + B x + C = 0
      UpperCamelCase       						=      outgoing_gradient**2 + 4
      UpperCamelCase       						=      2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
      UpperCamelCase       						=      (point_y - outgoing_gradient * point_x) ** 2 - 100

      UpperCamelCase       						=      (
          -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term					)
      ) / (2 * quadratic_term)
      UpperCamelCase       						=      (
          -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term					)
      ) / (2 * quadratic_term)

      # two solutions, one of which is our input point
      UpperCamelCase       						=      x_minus if isclose(__UpperCamelCase	,		__UpperCamelCase					) else x_plus
      UpperCamelCase       						=      point_y + outgoing_gradient * (next_x - point_x)

      return next_x, next_y, outgoing_gradient







def 					lowercase__				(   __UpperCamelCase = 1.4	,		__UpperCamelCase = -9.6					)->				int:
      UpperCamelCase       						=      0
      UpperCamelCase       						=      first_x_coord
      UpperCamelCase       						=      first_y_coord
      UpperCamelCase       						=      (10.1 - point_y) / (0.0 - point_x)

      while not (-0.01 <= point_x <= 0.01 and point_y > 0):
            UpperCamelCase						,UpperCamelCase						,UpperCamelCase       						=      next_point(__UpperCamelCase	,		__UpperCamelCase	,		__UpperCamelCase					)
            num_reflections += 1

      return num_reflections


if __name__ == "__main__":
     print(f'{solution() = }')








'''simple docstring'''

def 					lowercase__				(   __UpperCamelCase					)->				str:
      if not all(char in """01""" for char in bin_string					):
            raise ValueError("""Non-binary value was passed to the function"""					)
      if not bin_string:
            raise ValueError("""Empty string was passed to the function"""					)
      UpperCamelCase       						=      """"""
      while len(__UpperCamelCase					) % 3 != 0:
            UpperCamelCase       						=      """0""" + bin_string
      UpperCamelCase       						=      [
          bin_string[index : index + 3]
          for index in range(len(__UpperCamelCase					)					)
          if index % 3 == 0
      ]
      for bin_group in bin_string_in_3_list:
            UpperCamelCase       						=      0
            for index, val in enumerate(__UpperCamelCase					):
                  oct_val += int(2 ** (2 - index) * int(__UpperCamelCase					)					)
            oct_string += str(__UpperCamelCase					)
      return oct_string


if __name__ == "__main__":
     from doctest import testmod

     testmod()
