You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
484 B
R
14 lines
484 B
R
##################################################
|
|
#################### nm2eV #######################
|
|
##################################################
|
|
nm2eV <- function(nm) {
|
|
# Converts wavelength in nm to energy in eV
|
|
#
|
|
# Define some constants needed for the calculations
|
|
Plancks.constant <- 4.135667516E-15 # \electron\volt\per\second
|
|
speed.of.light <- 299792458 # \meter\per\second
|
|
|
|
eV <- Plancks.constant * 1E9 * speed.of.light / nm
|
|
return(eV)
|
|
}
|