Skip to content

Commit 2bb93bf

Browse files
authored
Fix grammar in relativistic kinetic energy comments
Corrected minor grammatical errors in comments and documentation.
1 parent aa6f775 commit 2bb93bf

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

physics/relativistic_kinetic_energy.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
2222
y = 1 / sqrt(1 - v^2 / c^2)
2323
24-
is the Lorentz factor. At speeds much smaller than c, this expression reduces to the
24+
is the Lorentz factor. At speeds much lower than c, this expression reduces to the
2525
classical formula K ≈ (1/2) m v^2, so the relativistic result agrees with Newtonian
26-
kinetic energy in the low velocity limit.The standard unit of kinetic energy is the
26+
kinetic energy in the low-velocity limit. The standard unit of kinetic energy is the
2727
joule, while the English unit of kinetic energy is the foot-pound.
2828
29-
Reference : https://en.wikipedia.org/wiki/Kinetic_energy
29+
Reference: https://en.wikipedia.org/wiki/Kinetic_energy
3030
"""
3131

3232
from math import sqrt
@@ -56,9 +56,8 @@ def relativistic_kinetic_energy(mass: float, velocity: float) -> float:
5656

5757
if mass < 0:
5858
raise ValueError("The mass of a body cannot be negative")
59-
else:
60-
gamma = 1 / sqrt(1 - (velocity**2 / c**2))
61-
return (gamma - 1) * mass * c**2
59+
gamma = 1 / sqrt(1 - (velocity**2 / c**2))
60+
return (gamma - 1) * mass * c**2
6261

6362

6463
if __name__ == "__main__":

0 commit comments

Comments
 (0)