Definition at line 42 of file IDistribution2DSampler.h.
◆ Distribution2DGaussSampler()
Distribution2DGaussSampler::Distribution2DGaussSampler |
( |
double |
omega_x, |
|
|
double |
omega_y |
|
) |
| |
|
inline |
◆ randomSample()
std::pair< double, double > Distribution2DGaussSampler::randomSample |
( |
| ) |
const |
|
finalvirtual |
Implements IDistribution2DSampler.
Definition at line 141 of file IDistribution2DSampler.cpp.
143 std::random_device rd;
144 std::mt19937 gen(rd());
145 std::uniform_real_distribution<double> uniformDist(0.0, 1.0);
147 double cdf_value_phi = uniformDist(gen);
150 double phi = std::sqrt(-2 * std::log(1 - cdf_value_phi));
151 double alpha = 2 *
M_PI * uniformDist(gen);
152 return std::make_pair(
m_omega_x * phi * std::cos(alpha),
m_omega_y * phi * std::sin(alpha));
References m_omega_x, m_omega_y, and M_PI.
◆ m_omega_x
double Distribution2DGaussSampler::m_omega_x |
|
private |
◆ m_omega_y
double Distribution2DGaussSampler::m_omega_y |
|
private |
The documentation for this class was generated from the following files: