We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f28799 commit b4e8ef5Copy full SHA for b4e8ef5
include/delaunator.cpp
@@ -305,7 +305,8 @@ Delaunator::Delaunator(std::vector<double> const& in_coords)
305
{ return dists[i] < dists[j]; });
306
307
// initialize a hash table for storing edges of the advancing convex hull
308
- m_hash_size = static_cast<std::size_t>(std::ceil(std::sqrt(n)));
+ // 1.618 is the golden ratio.
309
+ m_hash_size = static_cast<std::size_t>(1.618 * std::ceil(std::sqrt(n)));
310
m_hash.resize(m_hash_size);
311
std::fill(m_hash.begin(), m_hash.end(), INVALID_INDEX);
312
0 commit comments