angular.h file
Level-symmetric sphere quadrature and phase functions.
Static tables for $S_2, S_4, S_6, S_8$. Weights sum to $4\pi$. Nodes lie on the unit sphere. The isotropic phase is $1/(4\pi)$; Henyey–Greenstein at $g = 0$ matches it.
Functions
- auto vm_angular_count(int n) -> int
- Number of directions in the
$S_N$set. -
auto vm_angular_sn(int n,
vm_
float_ t* mu, vm_ float_ t* eta, vm_ float_ t* xi, vm_ float_ t* w) -> int - Fill caller-owned arrays with the
$S_N$nodes and weights. -
auto vm_angular_isotropic(void) -> vm_
float_ t - Isotropic phase function
$1/(4\pi)$. -
auto vm_angular_hg(vm_
float_ t mu, vm_ float_ t g) -> vm_ float_ t - Henyey–Greenstein phase
$P(\mu; g)$. -
auto vm_angular_scatter(const vm_
float_ t* mu, const vm_ float_ t* eta, const vm_ float_ t* xi, const vm_ float_ t* w, const vm_ float_ t* I, int n, vm_ float_ t ox, vm_ float_ t oy, vm_ float_ t oz, vm_ float_ t g) -> vm_ float_ t - Scattering source at one direction.
Function documentation
int vm_angular_count(int n)
Number of directions in the $S_N$ set.
| Returns | Direction count, or 0 if n is not supported. |
|---|
int vm_angular_sn(int n,
vm_ float_ t* mu,
vm_ float_ t* eta,
vm_ float_ t* xi,
vm_ float_ t* w)
Fill caller-owned arrays with the $S_N$ nodes and weights.
| Parameters | |
|---|---|
| n | |
| mu | Output direction cosine in x. |
| eta | Output direction cosine in y. |
| xi | Output direction cosine in z. |
| w | Output weight. |
| Returns | Number of directions written, or 0 on invalid input. |
Each of mu, eta, xi, w has length at least vm_.
vm_ float_ t vm_angular_hg(vm_ float_ t mu,
vm_ float_ t g)
Henyey–Greenstein phase $P(\mu; g)$.
| Parameters | |
|---|---|
| mu | Cosine of the scattering angle. |
| g | Asymmetry parameter in $[-1, 1]$. |
| Returns | Phase value. g = 0 matches the isotropic phase. |
vm_ float_ t vm_angular_scatter(const vm_ float_ t* mu,
const vm_ float_ t* eta,
const vm_ float_ t* xi,
const vm_ float_ t* w,
const vm_ float_ t* I,
int n,
vm_ float_ t ox,
vm_ float_ t oy,
vm_ float_ t oz,
vm_ float_ t g)
Scattering source at one direction.
| Parameters | |
|---|---|
| mu | Ordinate cosines in x; length n. |
| eta | Ordinate cosines in y; length n. |
| xi | Ordinate cosines in z; length n. |
| w | Ordinate weights; length n. |
| I | Intensity at each ordinate; length n. |
| n | |
| ox | Target direction cosine in x. |
| oy | Target direction cosine in y. |
| oz | Target direction cosine in z. |
| g | Asymmetry parameter. |
| Returns | Scattering source. |
$\sum_m w_m P(\boldsymbol{\Omega}_m\cdot\boldsymbol{\Omega}) I_m$. g = 0 uses the isotropic phase.