





from __future__ import annotations

import math
from collections.abc import Callable





def      lowerCAmelCase_ (       __a	,    __a	,    __a	,    __a = 100	,    )     ->		float:







  """simple docstring"""





  lowerCamelCase__:      List[str]			  =x_start
  lowerCamelCase__:      List[str]			  =fnc(__a		)
  lowerCamelCase__:      Union[str, Any]			  =0.0

  for _ in range(__a		):
    # Approximates curve as a sequence of linear lines and sums their length
    lowerCamelCase__:      int			  =(x_end - x_start) / steps + xa
    lowerCamelCase__:      Tuple			  =fnc(__a		)
    length += math.hypot(xa - xa	,    fxa - fxa		)

    # Increment step
    lowerCamelCase__:      Optional[Any]			  =xa
    lowerCamelCase__:      List[str]			  =fxa

  return length


if __name__ == "__main__":





     def      lowerCAmelCase_ (       __a		)     ->		List[Any]:







       """simple docstring"""





       return math.sin(10 * x		)

     print("f(x) = sin(10 * x)")
     print("The length of the curve from x = -10 to x = 10 is:")
     __A									=				10
     while i <= 10_0000:
          print(f'With {i} steps: {line_length(f, -10, 10, i)}')
          i *= 10







from collections.abc import Callable

import numpy as np

def 			_SCREAMING_SNAKE_CASE			(							lowercase	:       Callable	,							lowercase	:       float	,							lowercase	:       float	,							lowercase	:       float	,							lowercase	:       float     ):


      '''simple docstring'''



      lowerCamelCase_		     =    int(np.ceil((x_end - xa) / step_size     )     )
      lowerCamelCase_		     =    np.zeros((n + 1,)     )
      lowerCamelCase_		     =    ya
      lowerCamelCase_		     =    xa

      for k in range(lowercase     ):
            lowerCamelCase_		     =    y[k] + step_size * ode_func(lowercase	,							y[k]     )
            lowerCamelCase_		     =    y[k] + (
                (step_size / 2) * (ode_func(lowercase	,							y[k]     ) + ode_func(x + step_size	,							lowercase     ))
            )
            x += step_size

      return y


if __name__ == "__main__":
 import doctest

 doctest.testmod()



