File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ def de_broglie_wavelength(momentum: float, in_ev: bool = False) -> str:
7
7
8
8
Parameters:
9
9
momentum (float): Momentum of the particle.
10
- in_ev (bool, optional): True if momentum is in eV·s.
10
+ in_ev (bool, optional): True if momentum is in eV·s.
11
11
If False, momentum is in kg·m/s.
12
12
13
13
Returns:
14
- str: The calculated de Broglie wavelength of the particle in meters,
14
+ str: The calculated de Broglie wavelength of the particle in meters,
15
15
formatted in scientific notation.
16
16
17
17
Raises:
@@ -37,7 +37,7 @@ def de_broglie_wavelength(momentum: float, in_ev: bool = False) -> str:
37
37
if momentum <= 0:
38
38
raise ValueError("Momentum can't be zero or negative.")
39
39
40
-
40
+
41
41
wavelength = PLANCK_CONSTANT_EVS / momentum if in_ev else PLANCK_CONSTANT_JS / momentum
42
42
return f"{wavelength:.8e}"
43
43
You can’t perform that action at this time.
0 commit comments