Move {MCBackscattering}R Documentation

Moves Single Photon in Media

Description

This function calculates the move of single photon in media.

Usage

Move(myObject)

Arguments

myObject

The mandatory parameter of this function is the MCBS class created by MCBS constructor function.

Details

The Move function, alias Move.MCBS, calculates updated position coordinates c(x,y,z) according to the motion vector c(u,v,w) and the travel length until next interaction event. The movement of single photon is calculated in 3 dimensional space. The length of the straight section a photon can travel until the next interaction event is estimated as -log( rnd ) where rnd is a uniformly distributed random variable from range 0-1.

Value

The Move function returns an MCBS object as class. Typically the same object is used in argument and result. As a result, the 3D position of the photon is updated:

x

position along x-axis

y

position along y-axis

z

position along z-axis, the depth

Note

Please note that this function is designed to be used in Simulation function. You may use it separately in case you design your own procedure. In such a case, please note that function Randomize prepares trajectory data for each photon and steps are done using move index myObject$midx.

See Also

MCBS for construction of object with initial input parameters. Simulation for running the simulation with adjusted parameters. Chart for plot of calculated photon flux profile. Export for export of photon flux with corresponding radii. Setup for initial computation of specular reflection and transport albedo. Launch for start position of single photon and initial direction in media. Bounce for interaction with surface and computation of photon flux leaving media. Absorb for absorption of single photon energy in interaction with media. Scatter for single photon scattering interaction with media. Randomize for adjustment of random trajectory vectors.

Examples

## Apple simulation data according to Qin and Lu (2006).
## DOI: 10.13031/2013.20862

# create object
cfgMedia <- c(0.63,30,0,1.4)
cfgSimulation <- c(1e6,0.05,1e-9,3,0.012)
apple <- MCBS(cfgMedia,cfgSimulation)
apple <- Setup(apple)
apple <- Randomize(apple)

# launch with 10° incident angle and move first photon
apple$idx <- 1
apple <- Launch(apple,10)
# first move
apple$midx <- 1
cat("Position",apple$x,":",apple$y,":",apple$z,"\n")
apple <- Move(apple)
cat("Position",apple$x,":",apple$y,":",apple$z,"\n")
# second move
apple$midx <- 2
apple <- Move(apple)
cat("Position",apple$x,":",apple$y,":",apple$z,"\n")


[Package MCBackscattering version 0.1.1 Index]