





'''simple docstring'''

from __future__ import annotations

from math import pow, sqrt







def  a__    (    lowercase :					float, lowercase :					float, lowercase :					float				)		->		dict[str, float]:





     """simple docstring"""

     if (resistance, reactance, impedance).count(0				) != 1:
          raise ValueError('''One and only one argument must be 0'''				)
     if resistance == 0:
          return {"resistance": sqrt(pow(_UpperCAmelCase, 2				) - pow(_UpperCAmelCase, 2				)				)}
     elif reactance == 0:
          return {"reactance": sqrt(pow(_UpperCAmelCase, 2				) - pow(_UpperCAmelCase, 2				)				)}
     elif impedance == 0:
          return {"impedance": sqrt(pow(_UpperCAmelCase, 2				) + pow(_UpperCAmelCase, 2				)				)}
     else:
          raise ValueError('''Exactly one argument must be 0'''				)


if __name__ == "__main__":
   import doctest

   doctest.testmod()










'''simple docstring'''

import math







def  a__    (    lowercase :					float, lowercase :					float				)		->		float:





     """simple docstring"""

     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(lowercase				)				) ** 2)


if __name__ == "__main__":
   import doctest

   doctest.testmod(name='malus_law')



