28 #ifndef UNIFORM_SPHERIC_SAMPLER
29 #define UNIFORM_SPHERIC_SAMPLER
41 :
Sampler(nbRays, Theta, Phi), _real_nb_rays(0), _n1(1), _n2(1), _thetaCalcul(0.), _i(1), _j(1)
86 computeThetaCalcul(++_i);
91 decimal phiCalcul = _j * (_phi / _n2);
112 computeThetaCalcul(_i);
119 return _real_nb_rays;
124 return static_cast<unsigned int>(
125 floor(_nb_rays * (sin(thetaCalcul + _theta / _n1) - sin(thetaCalcul - _theta / _n1)) / 2. + 0.5));
135 2 *
static_cast<unsigned int>(floor(
M_PI * sqrt(
static_cast<decimal>(_nb_rays)) / 8. + 0.5));
140 _thetaCalcul =
static_cast<decimal>(
static_cast<int>(_n1) - 2 *
static_cast<int>(i) + 1) * _theta /
146 _n2 =
static_cast<unsigned int>(floor(
147 _nb_rays * (sin(_thetaCalcul + _theta / _n1) - sin(_thetaCalcul - _theta / _n1)) / 2. + 0.5));
152 for (
unsigned int i = 1; i <= _n1; i++)
154 computeThetaCalcul(i);
156 _real_nb_rays += _n2;
Sampler class and its sub-classes describe ray generators used in AcousticRayTracer....
base_vec3< decimal > vec3