
from math import isclose, sqrt





def 						SCREAMING_SNAKE_CASE__     (   __lowerCAmelCase     ,		__lowerCAmelCase     ,		__lowerCAmelCase				):
    snake_case__    =					point_y / 4 / point_x
    snake_case__    =					2 * normal_gradient / (1 + normal_gradient * normal_gradient)
    snake_case__    =					(1 - normal_gradient * normal_gradient) / (
        1 + normal_gradient * normal_gradient
    )
    snake_case__    =					(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
    snake_case__    =					outgoing_gradient**2 + 4
    snake_case__    =					2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
    snake_case__    =					(point_y - outgoing_gradient * point_x) ** 2 - 100

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

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

    return next_x, next_y, outgoing_gradient





def 						SCREAMING_SNAKE_CASE__     (   __lowerCAmelCase = 1.4     ,		__lowerCAmelCase = -9.6				):
    snake_case__    =					0
    snake_case__    =					first_x_coord
    snake_case__    =					first_y_coord
    snake_case__    =					(10.1 - point_y) / (0.0 - point_x)

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

    return num_reflections


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





import math





def 						SCREAMING_SNAKE_CASE__     (   __lowerCAmelCase     ,		__lowerCAmelCase				):

    if initial_intensity < 0:
        raise ValueError("The value of intensity cannot be negative"				)
        # handling of negative values of initial intensity
    if angle < 0 or angle > 360:
        raise ValueError("In Malus Law, the angle is in the range 0-360 degrees"				)
        # handling of values out of allowed range
    return initial_intensity * (math.cos(math.radians(__lowerCAmelCase				)				) ** 2)


if __name__ == "__main__":
     import doctest

     doctest.testmod(name='''malus_law''')



