# NOT RUN {
# Values for some Miller indices
h <- 0:10
a <- 20
Zj <- 16
Bj <- 18 # Roughly corresponding to sigma 0.23
occj <- 1
fval <- scafac(h,a,Zj,occj,Bj)
plot(h,fval,pch=16,xlab="Miller index",ylab="Scattering factor",
ylim=c(0,16))
# Continuous resolution
h <- seq(0,10,length=1000)
fval <- scafac(h,a,Zj,occj,Bj)
points(h,fval,type="l",col=2)
# Scattering curve for a lighter atom
Zj <- 8
fval <- scafac(h,a,Zj,occj,Bj)
points(h,fval,type="l",col=3)
# Scattering curve for the same atom, just with smaller Bj (colder)
Bj <- 10
fval <- scafac(h,a,Zj,occj,Bj)
points(h,fval,type="l",col=4)
# }
Run the code above in your browser using DataLab