Skip to content

Commit

Permalink
Add a square root for radius to have uniform density of points in gen…
Browse files Browse the repository at this point in the history
…erated circles
  • Loading branch information
boxanm committed May 6, 2024
1 parent f4bcbf2 commit 82e6149
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pointmatcher/PointCloudGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ typename PointMatcher<T>::DataPoints PointMatcher<T>::PointCloudGenerator::gener
{
// Sample random values of theta and phi.
const ScalarType phi{ 2.0f * pi * uniformDistribution(randomNumberGenerator) };
const ScalarType radiusSample{ radius * uniformDistribution(randomNumberGenerator) };
const ScalarType radiusSample{ sqrt(radius * uniformDistribution(randomNumberGenerator)) };

// Pre-compute values, such as sine and cosine of phi and theta.
const ScalarType sinPhi{ std::sin(phi) };
Expand Down

0 comments on commit 82e6149

Please sign in to comment.