Skip to content

Commit 85b870c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6061cad commit 85b870c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

electronics/electric_potential_point_charge.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from __future__ import annotations
2+
23
""" https://en.wikipedia.org/wiki/Electric_potential"""
34
COULOMB_CONSTANT = 8.99e9 # N·m²/C², Coulomb's constant
5+
6+
47
def electric_potential_point_charge(charge: float, distance: float) -> float:
58
"""
69
Calculate the electric potential at a point due to a point charge.
@@ -37,6 +40,7 @@ def electric_potential_point_charge(charge: float, distance: float) -> float:
3740
return 0 # Zero potential for zero charge
3841
return (COULOMB_CONSTANT * charge) / distance
3942

43+
4044
if __name__ == "__main__":
4145
import doctest
4246

0 commit comments

Comments
 (0)