Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Menambah fitur untuk menghitung volume bola #92

Merged
merged 8 commits into from
Aug 21, 2024
14 changes: 14 additions & 0 deletions OpenSeries/matematika.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,20 @@ def turunan(
return (f(x + h) - f(x)) / h


def volume_bola(r: Union[int, float]) -> Union[float, error.ErrorTipeData]:
"""
Menghitung volume dari sebuah bola
Args:
r (Union[int, float]): input radius
Return:
float : volume dari bola
"""
if not isinstance(r, (float, int)):
return error.ErrorTipeData(["float", "int"])
else:
return (4 / 3) * constant.PI * r**3


def mean_absolut_deviasi(
nilai: list[int],
) -> Union[error.Error, error.ErrorTipeData, float]:
Expand Down