Skip to content

Commit

Permalink
-1 for rp
Browse files Browse the repository at this point in the history
  • Loading branch information
baptiste authored and baptiste committed Jun 22, 2014
1 parent 2a51a75 commit b4f0d22
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions R/dipole.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ integrand_rad <- function(d = 10, angle, wavelength,
cost <- cos(angle)
sint <- sin(angle)

rp <- recursive_fresnelcpp(wavelength=wavelength,
rp <- -1*recursive_fresnelcpp(wavelength=wavelength,
q = sint,
epsilon=epsilon,
thickness=thickness,
Expand Down Expand Up @@ -87,7 +87,7 @@ integrand_nr1 <- function(d=10, u, wavelength,
Nlambda <- length(k0)
Nq <- length(u)

rp <- recursive_fresnelcpp(wavelength=wavelength,
rp <- -1*recursive_fresnelcpp(wavelength=wavelength,
q = sqrt(1 - u^2),
epsilon=epsilon,
thickness=thickness,
Expand Down Expand Up @@ -136,7 +136,7 @@ integrand_nr2 <- function(d=10, u, wavelength,
Nlambda <- length(k0)
Nq <- length(u)

rp <- recursive_fresnelcpp(wavelength=wavelength,
rp <- -1*recursive_fresnelcpp(wavelength=wavelength,
q = sqrt(1 + u^2),
epsilon=epsilon,
thickness=thickness,
Expand Down Expand Up @@ -199,7 +199,7 @@ integrand_nr3 <- function(d=10, u, ucut, wavelength,
Jac <- matrix(1 / (1 - u)^2, Nlambda, Nq, byrow=TRUE)


rp <- recursive_fresnelcpp(wavelength=wavelength,
rp <- -1*recursive_fresnelcpp(wavelength=wavelength,
q = sqrt(1 + t^2),
epsilon=epsilon,
thickness=thickness,
Expand Down
10 changes: 5 additions & 5 deletions R/dipole_integrand.r
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ integrand_mtot <- function(d=10, q, wavelength,
Nq <- length(q)

u <- sqrt(1 - q^2 + 0i)
rp <- recursive_fresnelcpp(wavelength=wavelength,
q = q,
epsilon=epsilon,
thickness=thickness,
polarisation="p")$reflection
rp <- -1* recursive_fresnelcpp(wavelength=wavelength,
q = q,
epsilon=epsilon,
thickness=thickness,
polarisation="p")$reflection

rs <- recursive_fresnelcpp(wavelength=wavelength,
q = q,
Expand Down
3 changes: 2 additions & 1 deletion demo/decay_rates.r
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ distance <- function(d=1, material="silver", ...){


## ----simulation, message=TRUE, fig.width=10------------------------------
params <- expand.grid(d=c(1,5,10), material=c("silver", "gold"), stringsAsFactors = FALSE)
params <- expand.grid(d=c(1,5,10), material=c("silver", "gold"),
stringsAsFactors = FALSE)
all <- mdply(params, distance)

ggplot(all, aes(wavelength, value, colour=factor(d), linetype=orientation))+
Expand Down

0 comments on commit b4f0d22

Please sign in to comment.