Skip to content

Commit 6061cad

Browse files
authored
Update electric_potential_point_charge.py
1 parent f66caa7 commit 6061cad

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

electronics/electric_potential_point_charge.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
from __future__ import annotations
2-
32
""" https://en.wikipedia.org/wiki/Electric_potential"""
4-
53
COULOMB_CONSTANT = 8.99e9 # N·m²/C², Coulomb's constant
6-
7-
84
def electric_potential_point_charge(charge: float, distance: float) -> float:
95
"""
106
Calculate the electric potential at a point due to a point charge.
@@ -39,10 +35,8 @@ def electric_potential_point_charge(charge: float, distance: float) -> float:
3935
return float("inf") # Potential is infinity when distance is zero
4036
elif charge == 0:
4137
return 0 # Zero potential for zero charge
42-
4338
return (COULOMB_CONSTANT * charge) / distance
4439

45-
4640
if __name__ == "__main__":
4741
import doctest
4842

0 commit comments

Comments
 (0)