55 for (
int i = 0; i < num_samples; i++) {
56 double theta = std::acos(1.0 - 2.0 * (i + epsilon) /
57 (num_samples - 1.0 + 2.0 * epsilon));
58 double phi = two_pi_by_lambda * i;
59 Vec3d vert_sph = {1.0, theta, phi};
67 const double lambda = (1.0 + std::sqrt(5.0)) / 2.0;
68 const double two_pi_by_lambda = 2.0 *
Math::PI / lambda;
69 const double epsilon = 0.36;
A class for generating samples from a weighted spherical centroidal Voronoi tessellation.
Definition golden_spiral_sampler.hpp:17
VecXT< Vec3d > Get(int num_samples)
Generate a specified number of sample points.
Definition golden_spiral_sampler.hpp:52
GoldenSpiralSampler & operator=(const GoldenSpiralSampler &)=delete
Delete copy assignment operator.
GoldenSpiralSampler(const GoldenSpiralSampler &)=delete
Delete copy constructor.
static GoldenSpiralSampler & GetInstance()
Get a reference to the singleton GoldenSpiralSampler instance.
Definition golden_spiral_sampler.hpp:38
static constexpr double PI
Definition utils_math.hpp:15
static Vec3d SphericalToCartesian(Vec3d const &vert_sph)
Definition utils_math.cpp:206
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18