Photon-related functions.
More...
|
file | photons.h |
| API header file for photons in zscilib.
|
|
Photon-related functions.
◆ zsl_phy_photon_ener()
Calculates the energy of a photon in electronvolts.
- Parameters
-
lambda | Wavelength of the photon in meters. |
e | Pointer to the output energy in electronvolts. Will be set to NAN if the wavelength is zero or negative. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_photon_frequency()
Calculates the frequency of a photon in hertz given its wavelength.
- Parameters
-
lambda | Wavelength of the photon in meters. |
f | Pointer to the frequency in hertz. Will be set to NAN if the wavelength is zero or negative. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_photon_mom()
Calculates the linear momentum of a photon in electronvolts and seconds per meter.
- Parameters
-
lambda | Wavelength of the photon in meters. |
p | Pointer to the output momentum in electronvolts and seconds per meter. Will be set to NAN if the wavelength is zero or negative. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_photon_photoelectric()
Calculates the maximum kinetic energy in electronvolts of the electrons released in the photoelectric effect, when a light beam of frequency 'f' hits a material of work function 'w'.
- Parameters
-
f | Frequency of the incident photons in hertzs. |
w | Work function of the material in electronvolts. |
kmax | Pointer to the output kinetic energy in electronvolts. Will be set to NAN if either 'f' or 'w' are negative. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_photon_wavelength()
Calculates the wavelength of a photon in meters given its frequency.
- Parameters
-
f | Frequency of the photon in hertz. |
lambda | Pointer to the wavelength in meters. Will be set to NAN if the frequency is zero or negative. |
- Returns
- 0 if everything executed properly, error code on failure.