28 #ifndef UNIFORM_SPHERIC_SAMPLER_2
29 #define UNIFORM_SPHERIC_SAMPLER_2
41 :
Sampler(nbRays, Theta, Phi), _real_nb_rays(0), _n1(1), _n2(1), _dr(0.), _phi0(0.), _d_theta(0.),
42 _d_phi(0.), _thetaCalcul(0.), _i(1), _j(1)
95 computeThetaCalcul(++_i);
101 decimal phiCalcul = _j * _d_phi + _phi0;
118 _dr = sqrt(4.f /
static_cast<decimal>(_nb_rays));
124 computeThetaCalcul(_i);
131 return _real_nb_rays;
136 return static_cast<unsigned int>(floor(
M_2PI * cos(thetaCalcul) / (2. * _dr) + 0.5));
142 decimal dh = 2.f * _dr *
static_cast<float>(sin(
M_PI / 3.));
144 _n1 =
static_cast<unsigned int>(floor(
M_PI / _d_theta));
154 _n2 =
static_cast<unsigned int>(floor(
M_2PI * cos(_thetaCalcul) / (2. * _dr)));
160 for (
unsigned int i = 1; i <= _n1; i++)
162 computeThetaCalcul(i);
164 _real_nb_rays += _n2;
Sampler class and its sub-classes describe ray generators used in AcousticRayTracer....
base_vec3< decimal > vec3