mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
codespell --quiet-level=2 (#1711)
* codespell --quiet-level=2 Suppress the BINARY FILE warnings * fixup! Format Python code with psf/black push
This commit is contained in:

committed by
John Law

parent
2cf7e8f994
commit
46ac50a28e
@ -1,10 +1,13 @@
|
||||
from typing import Callable, Union
|
||||
import math as m
|
||||
|
||||
def line_length(fnc: Callable[[Union[int, float]], Union[int, float]],
|
||||
x_start: Union[int, float],
|
||||
x_end: Union[int, float],
|
||||
steps: int = 100) -> float:
|
||||
|
||||
def line_length(
|
||||
fnc: Callable[[Union[int, float]], Union[int, float]],
|
||||
x_start: Union[int, float],
|
||||
x_end: Union[int, float],
|
||||
steps: int = 100,
|
||||
) -> float:
|
||||
|
||||
"""
|
||||
Approximates the arc length of a line segment by treating the curve as a
|
||||
@ -48,10 +51,11 @@ def line_length(fnc: Callable[[Union[int, float]], Union[int, float]],
|
||||
|
||||
return length
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def f(x):
|
||||
return m.sin(10*x)
|
||||
return m.sin(10 * x)
|
||||
|
||||
print("f(x) = sin(10 * x)")
|
||||
print("The length of the curve from x = -10 to x = 10 is:")
|
||||
|
Reference in New Issue
Block a user