Zephyr Scientific Library (zscilib)
Files | Functions
Photons

Photon-related functions. More...

Files

file  photons.h
 API header file for photons in zscilib.
 

Functions

int zsl_phy_photon_ener (zsl_real_t lambda, zsl_real_t *e)
 Calculates the energy of a photon in electronvolts. More...
 
int zsl_phy_photon_mom (zsl_real_t lambda, zsl_real_t *p)
 Calculates the linear momentum of a photon in electronvolts and seconds per meter. More...
 
int zsl_phy_photon_wavelength (zsl_real_t f, zsl_real_t *lambda)
 Calculates the wavelength of a photon in meters given its frequency. More...
 
int zsl_phy_photon_frequency (zsl_real_t lambda, zsl_real_t *f)
 Calculates the frequency of a photon in hertz given its wavelength. More...
 
int zsl_phy_photon_photoelectric (zsl_real_t f, zsl_real_t w, zsl_real_t *kmax)
 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'. More...
 

Detailed Description

Photon-related functions.

Function Documentation

◆ zsl_phy_photon_ener()

int zsl_phy_photon_ener ( zsl_real_t  lambda,
zsl_real_t e 
)

Calculates the energy of a photon in electronvolts.

Parameters
lambdaWavelength of the photon in meters.
ePointer 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()

int zsl_phy_photon_frequency ( zsl_real_t  lambda,
zsl_real_t f 
)

Calculates the frequency of a photon in hertz given its wavelength.

Parameters
lambdaWavelength of the photon in meters.
fPointer 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()

int zsl_phy_photon_mom ( zsl_real_t  lambda,
zsl_real_t p 
)

Calculates the linear momentum of a photon in electronvolts and seconds per meter.

Parameters
lambdaWavelength of the photon in meters.
pPointer 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()

int zsl_phy_photon_photoelectric ( zsl_real_t  f,
zsl_real_t  w,
zsl_real_t kmax 
)

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
fFrequency of the incident photons in hertzs.
wWork function of the material in electronvolts.
kmaxPointer 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()

int zsl_phy_photon_wavelength ( zsl_real_t  f,
zsl_real_t lambda 
)

Calculates the wavelength of a photon in meters given its frequency.

Parameters
fFrequency of the photon in hertz.
lambdaPointer 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.