

from math import isclose, sqrt






def        UpperCamelCase_(							_snake_case   :  float       ,     _snake_case   :  float       ,     _snake_case   :  float	):




			"""simple docstring"""






			__a        =point_y / 4 / point_x
			__a        =2 * normal_gradient / (1 + normal_gradient * normal_gradient)
			__a        =(1 - normal_gradient * normal_gradient) / (
			    1 + normal_gradient * normal_gradient
			)
			__a        =(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
			__a        =outgoing_gradient**2 + 4
			__a        =2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
			__a        =(point_y - outgoing_gradient * point_x) ** 2 - 100

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

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

			return next_x, next_y, outgoing_gradient






def        UpperCamelCase_(							_snake_case   :  float = 1.4       ,     _snake_case   :  float = -9.6	):




			"""simple docstring"""






			__a        =0
			__a        =first_x_coord
			__a        =first_y_coord
			__a        =(10.1 - point_y) / (0.0 - point_x)

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

			return num_reflections


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











'''simple docstring'''






from math import isclose, sqrt


def  snake_case_     (					_lowerCAmelCase  :						float   ,      _lowerCAmelCase  :						float   ,      _lowerCAmelCase  :						float  )      ->   tuple[float, float, float]:
							UpperCAmelCase :       Optional[int] 							=		point_y / 4 / point_x
							UpperCAmelCase :       str 							=		2 * normal_gradient / (1 + normal_gradient * normal_gradient)
							UpperCAmelCase :       Any 							=		(1 - normal_gradient * normal_gradient) / (
							    1 + normal_gradient * normal_gradient
							)
							UpperCAmelCase :       Union[str, Any] 							=		(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 :       Union[str, Any] 							=		outgoing_gradient**2 + 4
							UpperCAmelCase :       Dict 							=		2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
							UpperCAmelCase :       List[Any] 							=		(point_y - outgoing_gradient * point_x) ** 2 - 100

							UpperCAmelCase :       List[str] 							=		(
							    -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term  )
							) / (2 * quadratic_term)
							UpperCAmelCase :       Optional[int] 							=		(
							    -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term  )
							) / (2 * quadratic_term)

							# two solutions, one of which is our input point
							UpperCAmelCase :       Optional[Any] 							=		x_minus if isclose(_lowerCAmelCase   ,      _lowerCAmelCase  ) else x_plus
							UpperCAmelCase :       Union[str, Any] 							=		point_y + outgoing_gradient * (next_x - point_x)

							return next_x, next_y, outgoing_gradient


def  snake_case_     (					_lowerCAmelCase  :						float = 1.4   ,      _lowerCAmelCase  :						float = -9.6  )      ->   int:
							UpperCAmelCase :       int 							=		0
							UpperCAmelCase :       float 							=		first_x_coord
							UpperCAmelCase :       float 							=		first_y_coord
							UpperCAmelCase :       float 							=		(1_0.1 - point_y) / (0.0 - point_x)

							while not (-0.0_1 <= point_x <= 0.0_1 and point_y > 0):
														UpperCAmelCase							,		UpperCAmelCase							,		UpperCAmelCase :       str 							=		next_point(_lowerCAmelCase   ,      _lowerCAmelCase   ,      _lowerCAmelCase  )
														num_reflections += 1

							return num_reflections


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





