Your calculation of the velocity is not correct.
//below i calculate starting speed, as far as i know trigonometry this sure ensure that particles will fly in all directions
tworzona.speed.x=distributionx(generator)*cos(radiany);
tworzona.speed.y=distributionx(generator)*sin(radiany);
A note on terminology: 'speed' is a scalar value, and does not have direction. You should use the term 'velocity' to denote a vector with both direction and speed.
The problem with the above code is that the x and y values are independently generated. If you were to compare the direction radiany
to the direction you actually assign to speed
you would see that they don't match up.
constexpr float pi = 3.1415926535f;
std::uniform_real_distribution<float> speed_distribution(0, 6);
std::uniform_real_distribution<float> direction_distribution(0, 2*pi);
float radians = direction_distribution(generator);
float speed = speed_distribution(generator);
unitvector.x = cos(radians);
unitvector.y = sin(radians);
tworzona.velocity.x = speed * cos(radians);
tworzona.velocity.y = speed * sin(radians);
Alternatively you can generate a random velocity directly, without using sine and cosine, by creating a vector distribution. An ad hoc implementation would look like:
const double max_speed = 6.0;
const double max_squared = max_speed * max_speed;
std::uniform_real_distribution<double> d(0.0, max_speed);
double x, y;
do {
x = d(generator);
y = d(generator);
} while (x*x+y*y > max_squared);
// x and y are the random velocity, uniformly distributed in all directions,
// speed uniformly distributed between 0 and max_speed.
If you wanted to get fancy you could wrap this up in a custom distribution and then your original code might look like:
my_vector_distribution<float, 2> velocity_distribution(6);
tworzona.velocity = velocity_distribution(generator);