userInThisWorld
userInThisWorld

Reputation: 1391

LogNormal Distribution / C++ gnu

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

Answers (1)

NaCl
NaCl

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

Related Questions