physics.malus_law

Functions

malus_law(→ float)

Module Contents

physics.malus_law.malus_law(initial_intensity: float, angle: float) float
>>> round(malus_law(10,45),2)
5.0
>>> round(malus_law(100,60),2)
25.0
>>> round(malus_law(50,150),2)
37.5
>>> round(malus_law(75,270),2)
0.0
>>> round(malus_law(10,-900),2)
Traceback (most recent call last):
    ...
ValueError: In Malus Law, the angle is in the range 0-360 degrees
>>> round(malus_law(10,900),2)
Traceback (most recent call last):
    ...
ValueError: In Malus Law, the angle is in the range 0-360 degrees
>>> round(malus_law(-100,900),2)
Traceback (most recent call last):
    ...
ValueError: The value of intensity cannot be negative
>>> round(malus_law(100,180),2)
100.0
>>> round(malus_law(100,360),2)
100.0