




"""simple docstring"""

from math import factorial, pi






def 		_snake_case	(   _snake_case				:   float							,    _snake_case				:   int = 30				)       ->   float:






      '''simple docstring'''


      if not isinstance(_snake_case							,    (int, float)				):
            raise ValueError('maclaurin_sin() requires either an int or float for theta'				)

      if not isinstance(_snake_case							,    _snake_case				) or accuracy <= 0:
            raise ValueError('maclaurin_sin() requires a positive int for accuracy'				)

      _A     =  float(_snake_case				)
      _A     =  theta // (2 * pi)
      theta -= 2 * div * pi
      return sum(
          (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1				) for r in range(_snake_case				)				)






def 		_snake_case	(   _snake_case				:   float							,    _snake_case				:   int = 30				)       ->   float:






      '''simple docstring'''


      if not isinstance(_snake_case							,    (int, float)				):
            raise ValueError('maclaurin_cos() requires either an int or float for theta'				)

      if not isinstance(_snake_case							,    _snake_case				) or accuracy <= 0:
            raise ValueError('maclaurin_cos() requires a positive int for accuracy'				)

      _A     =  float(_snake_case				)
      _A     =  theta // (2 * pi)
      theta -= 2 * div * pi
      return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r				) for r in range(_snake_case				)				)


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       print(maclaurin_sin(10))
       print(maclaurin_sin(-10))
       print(maclaurin_sin(10, 15))
       print(maclaurin_sin(-10, 15))

       print(maclaurin_cos(5))
       print(maclaurin_cos(-5))
       print(maclaurin_cos(10, 15))
       print(maclaurin_cos(-10, 15))







"""simple docstring"""

import math






def 		_snake_case	(   _snake_case				:   float							,    _snake_case				:   float				)       ->   float:






      '''simple docstring'''


      if (
          not isinstance(_snake_case							,    (int, float)				)
          or power_factor < -1
          or power_factor > 1
      ):
            raise ValueError('power_factor must be a valid float value between -1 and 1.'				)
      return apparent_power * power_factor






def 		_snake_case	(   _snake_case				:   float							,    _snake_case				:   float				)       ->   float:






      '''simple docstring'''


      if (
          not isinstance(_snake_case							,    (int, float)				)
          or power_factor < -1
          or power_factor > 1
      ):
            raise ValueError('power_factor must be a valid float value between -1 and 1.'				)
      return apparent_power * math.sqrt(1 - power_factor**2				)


if __name__ == "__main__":
       import doctest

       doctest.testmod()

