Fermat
Classes | Functions
Spherical and Zonal Harmonics

Detailed Description

Classes

struct  cugar::SH_basis< L >
 

Functions

template<typename Vector3 >
CUGAR_HOST_DEVICE float cugar::sh (const int32 l, const int32 m, const Vector3 &v)
 
template<int32 l, typename Vector3 >
CUGAR_HOST_DEVICE float cugar::sh (const int32 m, const Vector3 &v)
 
template<int32 l, int32 m, typename Vector3 >
CUGAR_HOST_DEVICE float cugar::sh (const Vector3 &v)
 
template<typename ZHVector , typename SHVector , typename Vector3 >
CUGAR_HOST_DEVICE void cugar::rotate_ZH (const int32 L, const ZHVector &zh_coeff, const Vector3 &d, SHVector &sh_coeff)
 
template<int32 L, typename ZHVector , typename SHVector , typename Vector3 >
CUGAR_HOST_DEVICE void cugar::rotate_ZH (const ZHVector &zh_coeff, const Vector3 &d, SHVector &sh_coeff)
 
template<int32 l, int32 m, typename Vector3 >
CUGAR_HOST_DEVICE float cugar::rotate_ZH (const float zh_l, const Vector3 &d)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::sh_legendre_polynomial (const uint32 l, const uint32 m, const float x, const float y)
 
template<typename OutputIterator >
CUGAR_HOST_DEVICE void cugar::sh_legendre_integrals (const uint32 n, const float x, OutputIterator r)
 
CUGAR_HOST_DEVICE float cugar::sh_polar_integral (const int32 m, const float phi)
 

Function Documentation

◆ rotate_ZH() [1/3]

template<typename ZHVector , typename SHVector , typename Vector3 >
CUGAR_HOST_DEVICE void cugar::rotate_ZH ( const int32  L,
const ZHVector &  zh_coeff,
const Vector3 &  d,
SHVector &  sh_coeff 
)

rotate a zonal harmonics to an arbitrary direction vector

Parameters
Lnumber of bands
zh_coeffinput Zonal Harmonics coefficients
dinput vector
sh_coeffoutput Spherical Harmonics coefficients

◆ rotate_ZH() [2/3]

template<int32 L, typename ZHVector , typename SHVector , typename Vector3 >
CUGAR_HOST_DEVICE void cugar::rotate_ZH ( const ZHVector &  zh_coeff,
const Vector3 &  d,
SHVector &  sh_coeff 
)

rotate a zonal harmonics to an arbitrary direction vector, with the number of bands specified at compile-time.

Parameters
zh_coeffinput Zonal Harmonics coefficients
dinput vector
sh_coeffoutput Spherical Harmonics coefficients

◆ rotate_ZH() [3/3]

template<int32 l, int32 m, typename Vector3 >
CUGAR_HOST_DEVICE float cugar::rotate_ZH ( const float  zh_l,
const Vector3 &  d 
)

return the (l,m) spherical harmonics coefficient of a zonal harmonics function rotated to match a given axis.

Parameters
zh_ll-band zonal harmonics coefficient
dinput vector

◆ sh() [1/3]

template<typename Vector3 >
CUGAR_HOST_DEVICE float cugar::sh ( const int32  l,
const int32  m,
const Vector3 &  v 
)

evaluate the (l,m)-th basis function on a given vector

Parameters
lband index
msubband index
vinput vector

◆ sh() [2/3]

template<int32 l, typename Vector3 >
CUGAR_HOST_DEVICE float cugar::sh ( const int32  m,
const Vector3 &  v 
)

evaluate the (l,m)-th basis function on a given vector, where l is determined at compile-time.

Parameters
msubband index
vinput vector

◆ sh() [3/3]

template<int32 l, int32 m, typename Vector3 >
CUGAR_HOST_DEVICE float cugar::sh ( const Vector3 &  v)

evaluate the (l,m)-th basis function on a given vector, where l and m are determined at compile-time.

Parameters
vinput vector

◆ sh_legendre_integrals()

template<typename OutputIterator >
CUGAR_HOST_DEVICE void cugar::sh_legendre_integrals ( const uint32  n,
const float  x,
OutputIterator  r 
)

evaluate the associated Legendre integrals for a basis of order n see Algorithm 1 in:

Importance Sampling Spherical Harmonics, W.Jarosz, N.Carr, H.W.Jensen

Parameters
nSH order
xcos(theta), the point of evaluation of the associated (indefinite) Legendre integrals
ra pointer to the output evaluations for all (l,m) with (0 <= l < n), (0 <= m <= l)

◆ sh_legendre_polynomial()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float cugar::sh_legendre_polynomial ( const uint32  l,
const uint32  m,
const float  x,
const float  y 
)

evaluate the associated Legendre polynomial P_l^m on x = cos(theta), y = sin(theta) = sqrt(1 - x*x)

◆ sh_polar_integral()

CUGAR_HOST_DEVICE float cugar::sh_polar_integral ( const int32  m,
const float  phi 
)

evaluate the integral of the polar angle function Phi^m(phi) see equation 14 in:

Importance Sampling Spherical Harmonics, W.Jarosz, N.Carr, H.W.Jensen

Parameters
mrequired order
phithe point of evaluation, in angular coordinates