Reputation: 1391
I want to generate random points (x,y) using log normal distribution in c++ gnu
I know it needs parameters mean and variance, but how I can call it?
Upvotes: 2
Views: 681
Reputation: 2723
Use the new cool C++11
STL random system.
std::mt19937 mt(/*seed*/);
std::lognormal_distribution<float> dist(/*mean*/, /*variance*/);
float randomValue = dist(mt);
Upvotes: 2