File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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:
77
88 Parameters:
99 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.
1111 If False, momentum is in kg·m/s.
1212
1313 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,
1515 formatted in scientific notation.
1616
1717 Raises:
@@ -37,7 +37,7 @@ def de_broglie_wavelength(momentum: float, in_ev: bool = False) -> str:
3737 if momentum <= 0:
3838 raise ValueError("Momentum can't be zero or negative.")
3939
40-
40+
4141 wavelength = PLANCK_CONSTANT_EVS / momentum if in_ev else PLANCK_CONSTANT_JS / momentum
4242 return f"{wavelength:.8e}"
4343
You can’t perform that action at this time.
0 commit comments