Skip to content

Commit 44f2aca

Browse files
authored
Enhance docstring with reference link
Updated docstring to include a reference link for the velocity addition formula.
1 parent 487dd7e commit 44f2aca

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

physics/relativistic_velocity_summation.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# The relativistic velocity summation formula calculates the combined velocity v2 of
2-
# an object moving at speed v1 relative to a frame that is itself moving at velocity v
3-
# relative to an observer. I take the last one to be strictly lower than the speed of
4-
# light.
5-
# The formula is v2 = (v1 + v)/(1 + v1 * v / c**2)
6-
# v1 - speed of the object relative to a moving frame
7-
# v - speed of the moving frame
8-
# c - speed of light in the vacuum
9-
# v2 - speed of the object relative to an observer
1+
"""
2+
The relativistic velocity summation formula calculates the combined velocity v2 of
3+
an object moving at speed v1 relative to a frame that is itself moving at velocity v
4+
relative to an observer. I take the last one to be strictly lower than the speed of
5+
light.
6+
The formula is v2 = (v1 + v)/(1 + v1 * v / c**2)
7+
v1 - speed of the object relative to a moving frame
8+
v - speed of the moving frame
9+
c - speed of light in a vacuum
10+
v2 - speed of the object relative to an observer
11+
12+
https://en.wikipedia.org/wiki/Velocity-addition_formula
13+
"""
1014

1115
c = 299792458
1216

0 commit comments

Comments
 (0)